key remapping: don't remap space in options dialog

The options dialog never accepts space, so remapping a key to it doesn't make sense, and it is possible the original key was one of the keys actually being listened for
This commit is contained in:
Adam
2020-10-28 16:05:48 -04:00
parent c4f019aff0
commit d3c0713969
3 changed files with 26 additions and 1 deletions

View File

@@ -155,7 +155,9 @@ class KeyRemappingListener implements KeyListener
}
}
if (plugin.isDialogOpen() && config.space().matches(e))
// Do not remap to space key when the options dialog is open, since the options dialog never
// listens for space, and the remapped key may be one of keys it listens for.
if (plugin.isDialogOpen() && !plugin.isOptionsDialogOpen() && config.space().matches(e))
{
mappedKeyCode = KeyEvent.VK_SPACE;
}

View File

@@ -144,6 +144,11 @@ public class KeyRemappingPlugin extends Plugin
|| !isHidden(WidgetInfo.BANK_PIN_CONTAINER);
}
boolean isOptionsDialogOpen()
{
return client.getWidget(WidgetInfo.DIALOG_OPTION) != null;
}
private boolean isHidden(WidgetInfo widgetInfo)
{
Widget w = client.getWidget(widgetInfo);