Merge pull request #4588 from Abextm/no-key-released
runelite-client: Make hotkeys run on KeyPressed
This commit is contained in:
@@ -175,7 +175,7 @@ public class ScreenshotPlugin extends Plugin
|
||||
private final HotkeyListener hotkeyListener = new HotkeyListener(() -> config.hotkey())
|
||||
{
|
||||
@Override
|
||||
public void hotkeyReleased()
|
||||
public void hotkeyPressed()
|
||||
{
|
||||
takeScreenshot(format(new Date()));
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ package net.runelite.client.util;
|
||||
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.util.function.Supplier;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import net.runelite.client.config.Keybind;
|
||||
import net.runelite.client.input.KeyListener;
|
||||
@@ -36,7 +35,6 @@ public abstract class HotkeyListener implements KeyListener
|
||||
{
|
||||
private final Supplier<Keybind> keybind;
|
||||
|
||||
@Getter
|
||||
private boolean isPressed = false;
|
||||
|
||||
private boolean isConsumingTyped = false;
|
||||
@@ -77,7 +75,6 @@ public abstract class HotkeyListener implements KeyListener
|
||||
{
|
||||
isPressed = false;
|
||||
isConsumingTyped = false;
|
||||
hotkeyReleased();
|
||||
if (Keybind.getModifierForKeyCode(e.getKeyCode()) == null)
|
||||
{
|
||||
// Only consume non modifier keys
|
||||
@@ -89,8 +86,4 @@ public abstract class HotkeyListener implements KeyListener
|
||||
public void hotkeyPressed()
|
||||
{
|
||||
}
|
||||
|
||||
public void hotkeyReleased()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user