Skip to content

Commit 699a793

Browse files
authored
Update KeyboardDetectorClient.java
Allow all key detection(Except values with system keys)
1 parent bab5d70 commit 699a793

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/client/java/com/keyboarddetector/KeyboardDetectorClient.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,17 @@ public void onInitializeClient() {
3131
}
3232

3333
Set<Byte> pressedKeys = new HashSet<>();
34-
for (byte ascii = 48; ascii < 58; ascii++) {
35-
if (isKeyPressed(ascii)) {
36-
pressedKeys.add(ascii);
37-
}
38-
}
39-
for (byte ascii = 65; ascii < 91; ascii++) {
34+
for (byte ascii = 32; ascii < 127; ascii++) {
4035
if (isKeyPressed(ascii)) {
4136
pressedKeys.add(ascii);
4237
}
4338
}
39+
4440
if (!pressedKeys.isEmpty()) {
4541
ClientPlayNetworking.send(new S2CInputPayload(pressedKeys));
4642
ClientPlayNetworking.send(new S2CInputPayloadForKeyTap(pressedKeys));
4743
ClientPlayNetworking.send(new S2CInputPayloadForGroup(pressedKeys));
4844
}
4945
});
5046
}
51-
}
47+
}

0 commit comments

Comments
 (0)