Name: commandKeyDown

Type: message

Syntax: commandKeyDown <keyName> 

Summary: Sent when a Command <key combination> (Control-key on <Unix> or <Windows>) is pressed.

Introduced: 1.0

OS: mac,windows,linux

Platforms: desktop,server,web

Example:
on commandKeyDown theKey -- make Command-5 go back
  if theKey is "5" then go recent card else pass commandKeyDown
end commandKeyDown

Parameters:
keyName: The actual character of the pressed key.

Description:
Handle the <commandKeyDown> message if you want to provide Command-key or Control-key shortcuts (other than those provided in <menus> and <button> accelerators).

The <commandKeyDown> <message> is sent to the <active (focused) control(glossary)>, or to the <current card> if no <control> is <focus|focused>.

If the Command key is pressed along with the Return, Tab, Backspace, Delete, or Enter key, with an arrow key, or with a function key, no <commandKeyDown> <message> is sent. Instead, the <returnKey>, <tabKey>, <backspaceKey>, <deleteKey>, <enterKey>, <arrowKey> or <functionKey> <message> is sent. To trap a combination such as Command-Return or Control-Return, use a <returnKey> <handler> and check the <commandKey> <function> inside the <handler>.

>*Cross-platform note:*  On <Mac OS|Mac OS systems>, the <commandKeyDown> <message> is sent when the user presses a key while holding down the <Command key>. On <Unix> or <Windows|Windows systems>, the <commandKeyDown> <message> is sent when the user presses the Control key, whether or not another key is pressed at the same time.

References: control (keyword), functionKey (message), enterKey (message), arrowKey (message), deleteKey (message), tabKey (message), backspaceKey (message), controlKeyDown (message), optionKeyDown (message), returnKey (message), commandKey (function), controlKey (function), menus (function), current card (glossary), key combination (glossary), handler (glossary), Windows (glossary), button (glossary), message (glossary), Command key (glossary), Mac OS (glossary), Unix (glossary), focus (glossary), active control (glossary), function (control_st)

Tags: ui
