Skip to content

Instantly share code, notes, and snippets.

@ruby0x1
Last active April 19, 2016 02:14
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruby0x1/480825c46a186467e65b to your computer and use it in GitHub Desktop.
Save ruby0x1/480825c46a186467e65b to your computer and use it in GitHub Desktop.
Prevent the space key from scrolling the page with luxe
import luxe.Input;
class Main extends luxe.Game {
override function config(config:luxe.AppConfig) {
config.web.prevent_default_keys.push(Key.space);
return config;
} //config
override function ready() {
} //ready
override function onkeyup( e:KeyEvent ) {
if(e.keycode == Key.escape) {
Luxe.shutdown();
}
} //onkeyup
override function update(dt:Float) {
} //update
} //Main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment