Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import kha.input.KeyCode;
- import kha.input.Keyboard;
- class Input {
- public function new() {
- Keyboard.get().notify(OnKeyDown, OnKeyUp);
- }
- public function OnKeyDown(key:KeyCode): Void {
- switch (key) {
- case KeyCode.W:
- // ...;
- case KeyCode.S:
- // ...;
- }
- }
- public function OnKeyUp(key:KeyCode): Void {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement