From 62a6466b7e119c134884fb0baf46f82ed9054669 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 7a98906822..8f762f319c 100644 --- a/hxd/Window.hl.hx +++ b/hxd/Window.hl.hx @@ -269,7 +269,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 ) { @@ -277,7 +277,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 ) {