Skip to content

Instantly share code, notes, and snippets.

@error454
Created October 2, 2012 03:31
Show Gist options
  • Save error454/3815996 to your computer and use it in GitHub Desktop.
Save error454/3815996 to your computer and use it in GitHub Desktop.
Keyboard event handling blog sample
--------------------------------------------------------------------------------
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