Error getting tags :
error 404Error getting tags :
error 404 keyDown | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
keyDown
Basics
Expander triangle
Type
Message
Syntax

keyDown keyName

Introduced
1.0
Environment
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
Security
None required
Summary
Sent when the user presses a key.
Examples

on keyDown theKey
if theKey is not a number then beep
else pass keyDown
end keyDown

Additional Comments
Expander triangle

Handle the keyDown message if you want to do something special when the user presses any key or a particular key you check for in the handler.

Parameters:

The keyName is the actual character of the pressed key.

Comments:

The message is sent to the active (focused) control, or to the current card if no control is focused.

If the key pressed is the Return, Tab, Backspace, Delete, or Enter key, an arrow key, or a function key, no keyDown message is sent. Instead, the returnKey, tabKey, backspaceKey, deleteKey, enterKey, arrowKey, or functionKey message is sent.

If the insertion point is in a field, the entry of typed characters is triggered by the keyDown message. This means that trapping the keyDown message and not passing it prevents typing from being entered in the field.

Note: The keyDownmessage is sent before the character is placed in the field, so if you need to use the new content of the field, handle the keyUpmessage instead.

Note: The keydown message is not sent when either of the Option, Control or Command keys are down. In this case, first a rawKeyDown message is sent, then one of optionKeyDown, controlKeyDown or commandKeyDown is sent instead of keydown.

User Comments
Expander triangle