Advertisement
Guest User

Untitled

a guest
Jul 17th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Haxe 0.35 KB | None | 0 0
  1. import kha.input.KeyCode;
  2. import kha.input.Keyboard;
  3.  
  4. class Input {
  5.  
  6.    
  7.     public function new() {
  8.         Keyboard.get().notify(OnKeyDown, OnKeyUp);
  9.     }
  10.    
  11.     public function OnKeyDown(key:KeyCode): Void {
  12.         switch (key) {
  13.             case KeyCode.W:
  14.                 // ...;
  15.  
  16.             case KeyCode.S:
  17.                 // ...;
  18.         }
  19.     }
  20.  
  21.     public function OnKeyUp(key:KeyCode): Void {
  22.        
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement