Added the repeatKey field to KeyEvent, distinguishing whether the event was triggered by the key being held down or the first press.

This commit is contained in:
Luis C.M committed 2022-05-03 13:20:41 -05:00
1 parent 4c0ff9bf2e
commit 5c9424bac8
4 files changed
+13 -9

No files matched your search

@@ -41,16 +41,18 @@ public class PlayerEvent extends CustomNPCsEvent {
public final boolean isAltPressed;
public final boolean isShiftPressed;
public final boolean isMetaPressed;
public final boolean repeatKey;
public final boolean keyDown;
public final int[] keysDown;
public KeyPressedEvent(IPlayer player, int key, boolean isCtrlPressed, boolean isAltPressed, boolean isShiftPressed, boolean isMetaPressed, boolean keyDown, int[] heldKeys) {
public KeyPressedEvent(IPlayer player, int key, boolean isCtrlPressed, boolean isAltPressed, boolean isShiftPressed, boolean isMetaPressed, boolean repeatKey, boolean keyDown, int[] heldKeys) {
super(player);
this.key = key;
this.isCtrlPressed = isCtrlPressed;
this.isAltPressed = isAltPressed;
this.isShiftPressed = isShiftPressed;
this.isMetaPressed = isMetaPressed;
this.repeatKey = repeatKey;
this.keyDown = keyDown;
this.keysDown = heldKeys;
}