on.arrowUp

From Inspired-Lua Wiki
Revision as of 14:33, 1 June 2011 by Jimbauwens (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

on.arrowUp() is an event handler.
This handler get called when the UP arrow key gets pressed.

Example

msg = ""

function on.paint(gc)
	gc:drawString(msg, 10, 10, "top")
end

function on.arrowUp()
	msg = "Key up"
	platform.window:invalidate()
end

function on.arrowDown()
	msg = "Key down"
	platform.window:invalidate()
end

function on.arrowLeft()
	msg = "Key left"
	platform.window:invalidate()
end

function on.arrowRight()
	msg = "Key right"
	platform.window:invalidate()
end

Prints which arrow key gets pressed.

See Also