Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Bitmap text
Acrobat ActiveX Control
Golden Gate
DirectTransition
Lingo-An Advanced Guide to Directors Scripting Language
Minimizer
PopUp Field
Sprite Blender - Time
Change the Pattern of a Shape Sprite
Trigonometry Class v0.6
MediaMacros Xtras Mall
 

 

 

Behavior Generic behavior to get Key State.

Added on 3/24/2002

 

Compatibilities:
behavior D6_5 D7 D8 D8_5 PC US

Required Xtras:
KeyboardControl Xtra Standard

This item has not yet been rated

Author: Shockdev

Allows to determine if the key is pressed.

-- Generic behavior to get key state
-- KeyboardControl Xtra 1.1 or later required

property Key

on getPropertyDescriptionList
  set description = [:]
  addProp description, #Key, [#default: "", #format:#string, #comment:"Key to be checked:"]
  return description
end

on getBehaviorDescription
  return "Gets the State of a given Key"
end

on enterFrame
  getState
end

on getState
  set Ok = KeyboardControlIsKeyDown(Key)
  if getAt(Ok,1) = 0 then
    case getAt(Ok,3) of
      0: set KeyState = "Up"
      1: set KeyState = "Down"
    end case
    if KeyState = "Down" then
      put "The following key is pressed: " & Key
    end if
  else
    -- An error has occured, show error code
    alert("Error: " & getAt(Ok,1) & " - base error code")
  end if
end

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail