Difference between revisions of "on.arrowUp"

From Inspired-Lua Wiki
Jump to navigation Jump to search
(Created page with " Category:Events")
 
Line 1: Line 1:
 +
on.'''arrowUp'''() is an event handler. <br> This handler get called when the UP arrow key gets pressed. <br>
  
 +
== Example  ==
  
 +
<source lang="lua">
 +
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
 +
 +
</source>
 +
 +
== See Also  ==
 +
 +
*[[on.arrowDown]]
 +
*[[on.arrowLeft]]
 +
*[[on.arrowRight]]
 +
*[[on.arrowKey]]
  
 
[[Category:Events]]
 
[[Category:Events]]

Revision as of 14:32, 1 June 2011

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

See Also