Control remap fixes

This commit is contained in:
Terry Hearst 2023-02-07 23:49:28 -05:00
parent 433bb9baaa
commit b53fe858d7
2 changed files with 5 additions and 2 deletions

View file

@ -328,6 +328,9 @@ class OptionsDlg extends GuiImage {
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);

View file

@ -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);
}
}