Livecode Wiki
Advertisement

A Message sent when the user releases a pressed key.

Message[]

Syntax:

keyUp <keyname>

The parameter "keyName: is the actual character of the pressed key.

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 keyUp message is sent.

On Mac OS systems, the keyUp message is sent after any keyDown handlers finish executing, whether or not the key has been released. On Unix and Windows systems, the keyUp message is sent when the key is released, after the typed character has been added to the current field. To test whether a key is actually being pressed, use the keysDown function.

Message handler[]

Examples:

on keyUp -- play a keyclick sound
  -- in this example, the parameter is not needed or used
  play audioClip "click"
end keyUp

Use the keyUp Message handler if you want to do something special when the user releases any key (or a particular key you check for in the handler).

See also: keysDown, keyDown, ArrowKey, controlKey, menus, functionKey, enterKey, arrowKey, deleteKey, tabKey, backspaceKey, controlKeyDown, optionKeyDown, returnKey, button, CutKey, CopyKey, PasteKey, UndoKey, RawKeyUp & RawKeyDown.

Advertisement