key remapping: add control remap
Co-authored-by: Adam <Adam@sigterm.info>
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.keyremapping;
|
||||
|
||||
import java.awt.event.InputEvent;
|
||||
import java.awt.event.KeyEvent;
|
||||
import net.runelite.client.config.Config;
|
||||
import net.runelite.client.config.ConfigGroup;
|
||||
@@ -286,4 +287,15 @@ public interface KeyRemappingConfig extends Config
|
||||
{
|
||||
return new ModifierlessKeybind(KeyEvent.VK_SPACE, 0);
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
position = 21,
|
||||
keyName = "control",
|
||||
name = "Control",
|
||||
description = "The key which will replace {Control}."
|
||||
)
|
||||
default ModifierlessKeybind control()
|
||||
{
|
||||
return new ModifierlessKeybind(KeyEvent.VK_UNDEFINED, InputEvent.CTRL_DOWN_MASK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,6 +162,11 @@ class KeyRemappingListener implements KeyListener
|
||||
mappedKeyCode = KeyEvent.VK_SPACE;
|
||||
}
|
||||
|
||||
if (config.control().matches(e))
|
||||
{
|
||||
mappedKeyCode = KeyEvent.VK_CONTROL;
|
||||
}
|
||||
|
||||
if (mappedKeyCode != KeyEvent.VK_UNDEFINED && mappedKeyCode != e.getKeyCode())
|
||||
{
|
||||
final char keyChar = e.getKeyChar();
|
||||
|
||||
Reference in New Issue
Block a user