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

@@ -69,6 +69,7 @@ public class PacketHandlerPlayer{
boolean isShiftPressed = buffer.readBoolean();
boolean isAltPressed = buffer.readBoolean();
boolean isMetaPressed = buffer.readBoolean();
boolean repeatKey = buffer.readBoolean();
boolean buttonDown = buffer.readBoolean();
String ints = Server.readString(buffer);
@@ -88,7 +89,7 @@ public class PacketHandlerPlayer{
keysDown = new int[0];
}
EventHooks.onPlayerKeyPressed(player, button, isCtrlPressed, isShiftPressed, isAltPressed, isMetaPressed, buttonDown, keysDown);
EventHooks.onPlayerKeyPressed(player, button, isCtrlPressed, isShiftPressed, isAltPressed, isMetaPressed, repeatKey, buttonDown, keysDown);
}
else if(type == EnumPlayerPacket.MouseClicked) {
if(ScriptController.Instance.languages.isEmpty()) {