Browse Source

always init Keys on scene init

trethaller 6 years ago
parent
commit
fee6da77b8
2 changed files with 1 additions and 6 deletions
  1. 0 1
      hide/Ide.hx
  2. 1 5
      hide/comp/Scene.hx

+ 0 - 1
hide/Ide.hx

@@ -110,7 +110,6 @@ class Ide {
 					return;
 					return;
 			window.close(true);
 			window.close(true);
 		});
 		});
-		window.on('blur', function() if( h3d.Engine.getCurrent() != null && !hasReloaded ) hxd.Key.initialize());
 
 
 		// handle commandline parameters
 		// handle commandline parameters
 		nw.App.on("open", function(cmd) {
 		nw.App.on("open", function(cmd) {

+ 1 - 5
hide/comp/Scene.hx

@@ -52,7 +52,6 @@ class SceneLoader extends hxd.fmt.hsd.Serializer {
 class Scene extends Component implements h3d.IDrawable {
 class Scene extends Component implements h3d.IDrawable {
 
 
 	static var UID = 0;
 	static var UID = 0;
-	static var firstInit = true;
 
 
 	var id = ++UID;
 	var id = ++UID;
 	var window : hxd.Window;
 	var window : hxd.Window;
@@ -108,10 +107,7 @@ class Scene extends Component implements h3d.IDrawable {
 			new Element(canvas).on("resize", function() {
 			new Element(canvas).on("resize", function() {
 				@:privateAccess window.checkResize();
 				@:privateAccess window.checkResize();
 			});
 			});
-			if( firstInit ) {
-				firstInit = false;
-				hxd.Key.initialize();
-			}
+			hxd.Key.initialize();
 			engine.setCurrent();
 			engine.setCurrent();
 			window.setCurrent();
 			window.setCurrent();
 			s2d = new h2d.Scene();
 			s2d = new h2d.Scene();