Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Iconizer
AppleEventHandler
Wheel Mouse
myFile
Binary Xtra
Set Reveal Method-Alphamania
Volume Control Behavior
RADAgent
Bevel Button-Alphamania
DaoX
MediaMacros Xtras Mall
 

 

 

Behavior Generic behavior to detect if the key has been pressed

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

Checks if the key has beed pressed during the time period between two events (mouse clicks). Very useful if you need to have statistics of keyboard usage.

-- Generic behavior to detect if the key has been pressed
-- KeyboardControl Xtra 1.1 or later required

property Key

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

on getBehaviorDescription
  return "Checks if the key has beed pressed during the time period between mouse clicks"
end

on mouseDown
  detectKey
end

on detectKey
  set Ok = KeyboardControlKeyBeenPressed(Key)
  if getAt(Ok,1) = 0 then
    case getAt(Ok,3) of
      0: set WasPressed = False
      1: set WasPressed = True
    end case
    if WasPressed = True then
      alert ("The " & Key & " key WAS PRESSED since the last click")
    else
      alert ("The " & Key & " key WAS NOT PRESSED since the last click")
    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