Name
CreateKeyDown -- create a new keydown object / OBSOLETE
Synopsis
CreateKeyDown(id,key$)
Function
Attention: This function is part of the Hollywood 1.x event library. You should not use it any longer. Please use the functions of the new library from Hollywood 2.0 which is much better.

Use this command to declare a key to monitor. If the user presses this key, Hollywood will Gosub() to the label called ONKEYDOWN with the number as specified in this command.

Key$ is a string representing a key on your keyboard. This can be one of the following control keys:

‘UP’
Cursor up
‘DOWN’
Cursor down
‘RIGHT’
Cursor right
‘LEFT’
Cursor left
‘HELP’
Help key
‘DEL’
Delete key
‘BACKSPACE’
Backspace key
‘TAB’
Tab key
‘RETURN’
Return/enter key
‘ESC’
Escape
‘SPACE’
Space key
‘F1 - F10’
Function keys

The other keys can be accessed by just specifying the character of the key in the string, e.g. "A", "!" or "-".

The following keys cannot be monitored: Alt keys, command keys and the control key.

Inputs
id
desired identifier for the button
key$
key to monitor
Example
CreateKeydown(1,"ESC")
While(quit=FALSE)
   WaitEvent
Wend
End

Label(ONKEYDOWN1)
quit=TRUE
Return
The above code waits for the user to press the escape key. Then it quits. A code structure like above is recommended for your applications.

Show TOC