/Keyboard-Manager

Lightweight Manager for keyboard control in openfl applications

Primary LanguageHaxeMIT LicenseMIT

Keyboard Manager

Lightweight Manager for keyboard control in openfl applications

Usage:

KeyboardManager.start(stage);

function onXPressed(){
  trace("X Key Pressed");
}

KeyboardManager.setKeyDownCallback(X, onXPressed);

//output: X Key Pressed
KeyboardManager.start(stage);

function onEnterFrame(e:Event){
 trace(KeyboardManager.isKeyDown(X));
}

addEventListener(Event.ENTER_FRAME, onEnterFrame);

//output: false