-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KeyPressedPreferNative: More performat key input #829
base: master
Are you sure you want to change the base?
KeyPressedPreferNative: More performat key input #829
Commits on Oct 15, 2024
-
KeyPressedPreferNative: More performat key input
On windows, `Gdx.input.isKeyPressed` uses lwjgl's event system for fetching key inputs. This event-based system sometimes lags due to OS issues, so beatoraja had problem getting key state ASAP. When pressing multiple keys, some keys were registered later than other keys. This commit fixes the issue by utilizing Windows's `GetAsyncKeyState` function for fetching current keyboard state itself. Note that this function will poll key state regardless of whether the window is focused or not, so this could be documented. Reference: previous libgdx input polling system (from LWJGL2) https://github.com/LWJGL/lwjgl/blob/master/src/java/org/lwjgl/opengl/WindowsKeyboard.java
Configuration menu - View commit details
-
Copy full SHA for 8fc25ce - Browse repository at this point
Copy the full SHA 8fc25ceView commit details
Commits on Oct 21, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 0bef0f0 - Browse repository at this point
Copy the full SHA 0bef0f0View commit details
Commits on Oct 22, 2024
-
perf(KeyPressedPreferNative): Use GetForegroundWindow instead of Disp…
…lay.isActive() Display.isActive() requires a global lock on the display object, so it frequently stalls, resulting in less-than-optimal gaming experience. To make things lock-free, we again use JNA to implement `Display.isActive()` ourselves. Note that this code is coded for lwjgl2 backend the beatoraja currently uses. To maximize modularity, All input-specific code are confined in KeyPressedPreferNative class only.
Configuration menu - View commit details
-
Copy full SHA for ced418f - Browse repository at this point
Copy the full SHA ced418fView commit details -
fix(KeyPressedPreferNative): Fix Alt+F4
Alt+F4 should kill the application.
Configuration menu - View commit details
-
Copy full SHA for 07a460c - Browse repository at this point
Copy the full SHA 07a460cView commit details
Commits on Oct 26, 2024
-
perf(KeyPressedPreferNative): fix slow polling of fn keys
Calling `Gdx.input.isKeyPressed` acquires lock of global some opengl mutex, so it takes quite a considerable amount of time. Filter out excessive calls with GetAsyncKeyState.
Configuration menu - View commit details
-
Copy full SHA for af89460 - Browse repository at this point
Copy the full SHA af89460View commit details -
perf(KeyPressedPreferNative): Replaced JNA with JNI inside lwjgls.
lwjgl already has implemented multiple JNIs for Windows APIs we need. Since JNI is much faster than JNA, with a help of various reflection help we use those native methods instead of maintaining our own c++/java JNI build native systems. - Corollary: removed JNA dependencies
Configuration menu - View commit details
-
Copy full SHA for a548fb9 - Browse repository at this point
Copy the full SHA a548fb9View commit details