Skip to content

WORLD1/2 keys for Lwjgl3 backends #7456

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

Merged
merged 3 commits into from
Apr 26, 2025

Conversation

curioustorvald
Copy link
Contributor

This patch enables GLFW_KEY_WORLD_1 (the key sits between LSHIFT and Z on ISO-layout keyboards) and GLFW_KEY_WORLD_2 keys (available in Japanese keyboards?) to be used with GDX for Lwjgl 3 backends.

@MonstrousSoftware
Copy link

Note that this overlaps with pull request #7446 which also maps the GLFW_KEY_WORLD_1 and GLFW_KEY_WORLD_2 to a new Gdx key code.

@dsalt
Copy link

dsalt commented Oct 15, 2024

For testing purposes, I started with 1.12.1, added the above patch and the following:

--- a/gdx/src/com/badlogic/gdx/Input.java
+++ b/gdx/src/com/badlogic/gdx/Input.java
@@ -613,6 +616,10 @@ public interface Input {
                                return "Pause";
                        case PRINT_SCREEN:
                                return "Print";
+                       case WORLD_1:
+                               return "\\ nonUS";
+                       case WORLD_2:
+                               return "\\ (nonUS)";
                        // BUTTON_CIRCLE unhandled, as it conflicts with the more likely to be pressed F12
                        default:
                                // key name not found

(I found this PR to be only partly useable without adding names.)

With the game which I was using for testing relinked against this, \ (UK layout) became useable and \ nonUS was shown for it (expected, given X11).

@obigu obigu added the LWJGL3 label Nov 12, 2024
@Tom-Ski Tom-Ski merged commit 078ba3c into libgdx:master Apr 26, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants