Created
October 2, 2012 03:31
-
-
Save error454/3815996 to your computer and use it in GitHub Desktop.
Keyboard event handling blog sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-------------------------------------------------------------------------------- | |
function InputAI.onKeyboardKeyDown ( kKeyCode ) | |
-------------------------------------------------------------------------------- | |
if( kKeyCode == input.kKeyW ) | |
then | |
--handle W | |
elseif( kKeyCode == input.kKeyA ) | |
then | |
--handle A | |
end | |
object.sendEvent( this.hSomeObject(), "anotherAI", "onKeyboardKeyDown", kKeyCode ) | |
-------------------------------------------------------------------------------- | |
end | |
-------------------------------------------------------------------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment