mirror of
https://github.com/GTNewHorizons/lwjgl3ify.git
synced 2026-11-21 04:32:30 +00:00
Use enhanced switch statements where appropriate
This commit is contained in:
1 parent
5b4af69330
commit
b752b2932f
18 files changed
+514
-841
No files matched your search
@@ -227,21 +227,15 @@ public class Keyboard {
|
||||
public static void addGlfwKeyEvent(long window, int key, int scancode, int action, int mods) {
|
||||
final KeyState state;
|
||||
switch (action) {
|
||||
case GLFW.GLFW_PRESS:
|
||||
state = KeyState.PRESS;
|
||||
break;
|
||||
case GLFW.GLFW_RELEASE:
|
||||
state = KeyState.RELEASE;
|
||||
break;
|
||||
case GLFW.GLFW_REPEAT:
|
||||
case GLFW.GLFW_PRESS -> state = KeyState.PRESS;
|
||||
case GLFW.GLFW_RELEASE -> state = KeyState.RELEASE;
|
||||
case GLFW.GLFW_REPEAT -> {
|
||||
state = KeyState.REPEAT;
|
||||
if (!doRepeatEvents) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
state = KeyState.RELEASE;
|
||||
break;
|
||||
}
|
||||
default -> state = KeyState.RELEASE;
|
||||
}
|
||||
keyEvents[queue.getNextPos()] = KeyCodes.toLwjglKey(key);
|
||||
keyEventStates[queue.getNextPos()] = state;
|
||||
|
||||
Reference in new issue
Block a user