Skip to content

Commit f565d7e

Browse files
committed
Make hotkeys trigger on keydown rather than keyup
1 parent c7db4d8 commit f565d7e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/TSMapEditor/UI/UIManager.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ private void InitTheme()
301301

302302
private void InitKeyboard()
303303
{
304-
Keyboard.OnKeyPressed += Keyboard_OnKeyPressed;
304+
Keyboard.OnKeyDown += Keyboard_OnKeyDown;
305305

306306
KeyboardCommands.Instance = new KeyboardCommands();
307307
KeyboardCommands.Instance.Undo.Triggered += UndoAction;
@@ -315,7 +315,7 @@ private void InitKeyboard()
315315

316316
private void ClearKeyboard()
317317
{
318-
Keyboard.OnKeyPressed -= Keyboard_OnKeyPressed;
318+
Keyboard.OnKeyDown -= Keyboard_OnKeyDown;
319319
KeyboardCommands.Instance.ClearCommandSubscriptions();
320320
}
321321

@@ -565,7 +565,7 @@ private void UpdateTileAndOverlaySelectorArea(object sender, EventArgs e)
565565
overlayFrameSelector.ClientRectangleUpdated += UpdateTileAndOverlaySelectorArea;
566566
}
567567

568-
private void Keyboard_OnKeyPressed(object sender, Rampastring.XNAUI.Input.KeyPressEventArgs e)
568+
private void Keyboard_OnKeyDown(object sender, Rampastring.XNAUI.Input.KeyPressEventArgs e)
569569
{
570570
if (!WindowManager.HasFocus)
571571
return;

0 commit comments

Comments
 (0)