Skip to content

Instantly share code, notes, and snippets.

@ibilon
Created August 23, 2013 15:32
Show Gist options
  • Save ibilon/6320656 to your computer and use it in GitHub Desktop.
Save ibilon/6320656 to your computer and use it in GitHub Desktop.
HaxePunk test keyboard input
import com.haxepunk.Engine;
import com.haxepunk.utils.Input;
import com.haxepunk.utils.Key;
import flash.events.KeyboardEvent;
import flash.Lib;
class Main extends Engine
{
override public function init()
{
Lib.current.stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
}
private function onKeyUp(e:KeyboardEvent):Void
{
trace(Key.nameOfKey(Input.keyCode(e)));
}
public static function main() { new Main(); }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment