From 4b58b5c246d42ff393e3bc321abfabfcd1ca5d33 Mon Sep 17 00:00:00 2001 From: Eric Ng Date: Thu, 18 May 2023 15:19:08 +0800 Subject: [PATCH] fix mouse position not added to EKeyDown and EKeyUp --- hxd/Window.hl.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hxd/Window.hl.hx b/hxd/Window.hl.hx index f830edd9c..fddc4ebcd 100644 --- a/hxd/Window.hl.hx +++ b/hxd/Window.hl.hx @@ -392,7 +392,7 @@ class Window { case GControllerAdded, GControllerRemoved, GControllerUp, GControllerDown, GControllerAxis: @:privateAccess hxd.Pad.onEvent( e ); case KeyDown: - eh = new Event(EKeyDown); + eh = new Event(EKeyDown, mouseX, mouseY); if( e.keyCode & (1 << 30) != 0 ) e.keyCode = (e.keyCode & ((1 << 30) - 1)) + 1000; eh.keyCode = CODEMAP[e.keyCode]; if( eh.keyCode & (K.LOC_LEFT | K.LOC_RIGHT) != 0 ) { @@ -400,7 +400,7 @@ class Window { onEvent(e); } case KeyUp: - eh = new Event(EKeyUp); + eh = new Event(EKeyUp, mouseX, mouseY); if( e.keyCode & (1 << 30) != 0 ) e.keyCode = (e.keyCode & ((1 << 30) - 1)) + 1000; eh.keyCode = CODEMAP[e.keyCode]; if( eh.keyCode & (K.LOC_LEFT | K.LOC_RIGHT) != 0 ) {