Explorar el Código

release all keys on blur

ncannasse hace 7 años
padre
commit
198ab29567
Se han modificado 1 ficheros con 9 adiciones y 0 borrados
  1. 9 0
      hxd/Stage.hl.hx

+ 9 - 0
hxd/Stage.hl.hx

@@ -150,6 +150,15 @@ class Stage {
 				wasBlurred = false;
 			case Blur:
 				wasBlurred = true;
+				#if hldx
+				// release all keys
+				var ev = new Event(EKeyUp);
+				for( i in 0...@:privateAccess hxd.Key.keyPressed.length )
+					if( hxd.Key.isDown(i) ) {
+						ev.keyCode = i;
+						event(ev);
+					}
+				#end
 			default:
 			}
 		case MouseDown: