{"identifier":40449,"topic":"Commands","name":"keyDown","text":"<code>keyDown <i>char<\/i><\/code> <br><br>\n\n The<code> keyDown <\/code>command simulates a key press from within a handler. It acts exactly as if the user pressed a character<code> <\/code>from the keyboard. <br><br>\n\n HyperCard sends the<code> keyDown <\/code>command to a field (if the insertion point is set) or to the current card when the user presses a key. The value passed to the parameter variable<code> <i>char<\/i> <\/code>corresponds to the key pressed. <br>\n<br>\nYou can handle the<code> keyDown <\/code>message as follows: <br><br>\n\n <code><pre>on keyDown theKey\n   <i>statements<\/i>\nend keyDown\n<\/pre><\/code>\nNote:<code> keyDown <\/code>is not sent for characters typed using the<code> type <\/code>command. <br>\n","related":{"8287":"commandKeyDown","3428":"Commands sent automatically","33000":"controlKey","60915":"optionKey","64480":"shiftKey","6031":"Where messages are sent initially"},"examples":"","demo":"on keyDownDemo\n   -- The <b>keyDown<\/b> messages are handled in the script of this card\n   show bkgnd field \"demo field\"\n   put \"Type any key...\" into bkgnd field \"demo field\"\n   put \"Press the Return key to continue...\" into \u00ac\n   line 6 of bkgnd field \"demo field\"\n end keyDownDemo\n <br><br>\n\n <br><br>\n\n <br><br>\n\n <br><br>\n\n <br><br>\n\n <br><br>\n\n <br><br>\n\n <br><br>\n\n ","debug":{"9":["keyDown char\r\rThe ke"],"10":["You can handle the k"]}}