Difference between revisions of "on.arrowKey"
Jump to navigation
Jump to search
(Created page with " Category:Events") |
Jimbauwens (talk | contribs) |
||
| Line 1: | Line 1: | ||
| + | on.'''arrowKey'''() is an event handler. <br> This handler get called when a arrow key gets pressed. This handler will '''not''' be called if you already use other handlers to catch arrow keys (such as on.arrowLeft).<br> | ||
| + | == Example == | ||
| + | <source lang="lua"> | ||
| + | msg = "" | ||
| + | |||
| + | function on.paint(gc) | ||
| + | gc:drawString(msg, 10, 10, "top") | ||
| + | end | ||
| + | |||
| + | function on.arrowKey(key) | ||
| + | msg = "Key " .. key | ||
| + | platform.window:invalidate() | ||
| + | end | ||
| + | |||
| + | </source> | ||
| + | |||
| + | == See Also == | ||
| + | |||
| + | *[[on.arrowDown]] | ||
| + | *[[on.arrowUp]] | ||
| + | *[[on.arrowRight]] | ||
| + | *[[on.arrowLeft]] | ||
[[Category:Events]] | [[Category:Events]] | ||
Latest revision as of 13:40, 1 June 2011
on.arrowKey() is an event handler.
This handler get called when a arrow key gets pressed. This handler will not be called if you already use other handlers to catch arrow keys (such as on.arrowLeft).
Example
msg = ""
function on.paint(gc)
gc:drawString(msg, 10, 10, "top")
end
function on.arrowKey(key)
msg = "Key " .. key
platform.window:invalidate()
end