Kaynağa Gözat

default static listener.

Nicolas Cannasse 19 yıl önce
ebeveyn
işleme
99a2de056d
2 değiştirilmiş dosya ile 9 ekleme ve 0 silme
  1. 4 0
      std/flash/Key.hx
  2. 5 0
      std/flash/Mouse.hx

+ 4 - 0
std/flash/Key.hx

@@ -36,6 +36,9 @@ extern class Key
 	static function isDown(code:Int):Bool;
 	static function isToggled(code:Int):Bool;
 
+	static function onKeyDown() : Void;
+	static function onKeyUp() : Void;
+
 #if flash_strict
 	static function addListener(listener:KeyListener):Void;
 	static function removeListener(listener:KeyListener):Bool;
@@ -46,6 +49,7 @@ extern class Key
 
 	private static function __init__() : Void untyped {
 		flash.Key = _global["Key"];
+		flash.Key.addListener(flash.Key);
 	}
 
 }

+ 5 - 0
std/flash/Mouse.hx

@@ -13,6 +13,10 @@ extern class Mouse
 {
 	static function show():Int;
 	static function hide():Int;
+	static function onMouseDown() : Void;
+	static function onMouseMove() : Void;
+	static function onMouseUp() : Void;
+
 #if flash_strict
 	static function addListener(listener:MouseListener):Void;
 	static function removeListener(listener:MouseListener):Bool;
@@ -23,6 +27,7 @@ extern class Mouse
 
 	private static function __init__() : Void untyped {
 		flash.Mouse = _global["Mouse"];
+		flash.Mouse.addListener(flash.Mouse);
 	}
 
 }