keyremapping: add option to remap space in dialog
This commit is contained in:
@@ -241,4 +241,15 @@ public interface KeyRemappingConfig extends Config
|
|||||||
{
|
{
|
||||||
return new ModifierlessKeybind(KeyEvent.VK_ESCAPE, 0);
|
return new ModifierlessKeybind(KeyEvent.VK_ESCAPE, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
position = 20,
|
||||||
|
keyName = "space",
|
||||||
|
name = "Space",
|
||||||
|
description = "The key which will replace {Space} when dialogs are open."
|
||||||
|
)
|
||||||
|
default ModifierlessKeybind space()
|
||||||
|
{
|
||||||
|
return new ModifierlessKeybind(KeyEvent.VK_SPACE, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -156,6 +156,11 @@ class KeyRemappingListener implements KeyListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (plugin.isDialogOpen() && config.space().matches(e))
|
||||||
|
{
|
||||||
|
mappedKeyCode = KeyEvent.VK_SPACE;
|
||||||
|
}
|
||||||
|
|
||||||
if (mappedKeyCode != KeyEvent.VK_UNDEFINED && mappedKeyCode != e.getKeyCode())
|
if (mappedKeyCode != KeyEvent.VK_UNDEFINED && mappedKeyCode != e.getKeyCode())
|
||||||
{
|
{
|
||||||
final char keyChar = e.getKeyChar();
|
final char keyChar = e.getKeyChar();
|
||||||
|
|||||||
Reference in New Issue
Block a user