on KEYDOWN/KEYUP

 

The on KEYDOWN and on KEYUP events trigger when a user presses or releases a key in a custom window.

 

Format:        on <level>:KEYDOWN:<@>:<key,...,keyN>:<commands>

Example:        on 1:KEYDOWN:@:*:echo User pressed key $keyval in $active

 

The on CHAR event returns translated keyboard presses and uses the same format as above.

 

Examples

 

on 1:KEYDOWN:@frog:32:echo user pressed space bar in @frog

 

This triggers when a user presses the space bar key in window @frog.

 

on 1:KEYDOWN:@:37,38,39,40:echo pressed cursor key $keyval $keyrpt

 

This triggers when a user presses any of the cursor keys in any window.

 

$keyval returns the key code of the key being pressed.

 

$keychar returns the actual letter of the key being pressed.

 

$keyrpt returns $true if the key is repeating due to a user holding down the key.

 

$keylparam returns the result of the lParam value in the keyboard event.