1
8
9
10 import com.sekati.log.Logger;
11 import com.sekati.utils.Delegate;
12
13
16 class com.sekati.input.KeyManager {
17
18 private static var _instance:KeyManager;
19 private static var _this:KeyManager;
20 private static var _key:Object;
21 private static var _keyDownEVENT:String = "onKeyDown";
22 private static var _keyUpEVENT:String = "onKeyUp";
23
24
27 private function KeyManager() {
28 _this = this;
29 _key = new Object( );
30 _key.onKeyDown = Delegate.create( _this, onKeyDown );
31 Key.addListener( _key );
32 }
33
34 private function onKeyDown():Void {
35
36 Logger.$.status(_this, "KeyDown ::: ascii:" + Key.getAscii( ) + ", keycode:" + Key.getCode( ) );
37 if ((Key.getCode( ) == Key.LEFT) && (Key.getCode( ) == Key.getCode.UP)) {
38
39 }
40 }
41
42 private function onKeyUp():Void {
43 Logger.$.status(_this, "The ASCII code for the KeyUp is: " + Key.getAscii( ) );
44 }
45
46 public function hotKey(k:Array):Boolean {
47
48 return false;
49 }
50
51
55 public static function getInstance():KeyManager {
56 if (!_instance) {
57 _instance = new KeyManager( );
58 }
59 return _instance;
60 }
61
62
66 public static function get $():KeyManager {
67 return KeyManager.getInstance( );
68 }
69 }