• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Part: VII Appendixes > The Key Object

The Key Object

Table A.10. Key Object Methods and Constants
NameMethod/Attribute/EventFormatDescription
Key.addListenerMKey.addListener (myObject)Registers myObject to receive notification when the onKeyDown and onKeyUp methods are invoked.
Key.getAsciiMKey.getAscii()Returns the ASCII value of the last key pressed.
Key.getCodeMKey.getCode()Returns the keycode of the last key pressed.
Key.isDownMKey.isDown (charCode)Returns true if the user presses the key whose character code is charCode.
Key.isToggledMKey.isToggled (charCode)Returns true if the key specified in charCode is activated. On the PC, charCode for Caps Lock is 20; for Num Lock, 144; and for Scroll Lock, 145. You can use Key.CAPSLOCK for Caps Lock.
Key.removeListenerMKey.removeListener (myObject)If myObject was previously registered with Key.addListener(), myObject is removed from the list of listeners.
Key.BACKSPACEAKey.BACKSPACEConstant associated with the keycode value for the Backspace key (8).
Key.CAPSLOCKAKey.CAPSLOCKConstant associated with the keycode value for the Caps Lock key (20).
Key.CONTROLAKey.CONTROLConstant associated with the keycode value for the Control key (17).
Key.DELETEKEYAKey.DELETEKEYConstant associated with the keycode value for the Delete key (46).
Key.DOWNAKey.DOWNConstant associated with the keycode value for the Down Arrow key (40).
Key.ENDAKey.ENDConstant associated with the keycode value for the End key (35).
Key.ENTERAKey.ENTERConstant associated with the keycode value for the Enter key (13).
Key.ESCAPEAKey.ESCAPEConstant associated with the keycode value for the Escape key (27).
Key.HOMEAKey.HOMEConstant associated with the keycode value for the Home key (36).
Key.INSERTAKey.INSERTConstant associated with the keycode value for the Insert key (45).
Key.LEFTAKey.LEFTConstant associated with the keycode value for the left arrow key (37).
Key.PGDNAKey.PGDNConstant associated with the keycode value for the Page Down key (34).
Key.PGUPAKey.PGUPConstant associated with the keycode value for the Page Up key (33).
Key.RIGHTAKey.RIGHTConstant associated with the keycode value for the right arrow key (39).
Key.SHIFTAKey.SHIFTConstant associated with the keycode value for the Shift key (16).
Key.SPACEAKey.SPACEConstant associated with the keycode value for the spacebar (32).
Key.TABAKey.TABConstant associated with the keycode value for the Tab key (9).
Key.UPAKey.UPConstant associated with the keycode value for the up arrow key (38).
Key.onKeyDownEmyObject.onKeyDown = function() { };Fires when a key is pressed.
Key.onKeyUpEmyObject.onKeyUp = function() { };Fires when a key is released.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint