From 855fe096c9809d7abbf48c552b33f6dae8c18970 Mon Sep 17 00:00:00 2001 From: Terry Hearst Date: Tue, 7 Feb 2023 23:49:28 -0500 Subject: [PATCH] Control remap fixes --- src/gui/OptionsDlg.hx | 3 +++ src/gui/RemapDlg.hx | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/OptionsDlg.hx b/src/gui/OptionsDlg.hx index e2dee61a..36398d66 100644 --- a/src/gui/OptionsDlg.hx +++ b/src/gui/OptionsDlg.hx @@ -414,6 +414,9 @@ Extensions: EAX 2.0, EAX 3.0, EAX Unified, and EAX-AC3"; remapDlg.remapCallback = (key) -> { MarbleGame.canvas.popDialog(remapDlg); + if (key == Key.ESCAPE) + return; + var conflicting = getConflictingBinding(bindingName, key); if (conflicting == null) { ctrl.txtCtrl.text.text = Util.getKeyForButton2(key); diff --git a/src/gui/RemapDlg.hx b/src/gui/RemapDlg.hx index 3cf82b7c..4484fd9f 100644 --- a/src/gui/RemapDlg.hx +++ b/src/gui/RemapDlg.hx @@ -43,9 +43,9 @@ class RemapDlg extends GuiControl { public override function update(dt:Float, mouseState:MouseState) { super.update(dt, mouseState); for (i in 0...1024) { - if (i == 5) + if (i == Key.MOUSE_WHEEL_DOWN || i == Key.MOUSE_WHEEL_UP) continue; - if (Key.isDown(i)) { + if (Key.isPressed(i)) { remapCallback(i); } }