{"action":"created","issue":{"url":"https://api.github.com/repos/libgdx/libgdx/issues/4119","repository_url":"https://api.github.com/repos/libgdx/libgdx","labels_url":"https://api.github.com/repos/libgdx/libgdx/issues/4119/labels{/name}","comments_url":"https://api.github.com/repos/libgdx/libgdx/issues/4119/comments","events_url":"https://api.github.com/repos/libgdx/libgdx/issues/4119/events","html_url":"https://github.com/libgdx/libgdx/issues/4119","id":158218509,"number":4119,"title":"[FR] Add 2 GLFW keycodes for better non-US keyboard support","user":{"login":"Fringale","id":2722396,"avatar_url":"https://avatars.githubusercontent.com/u/2722396?v=3","gravatar_id":"","url":"https://api.github.com/users/Fringale","html_url":"https://github.com/Fringale","followers_url":"https://api.github.com/users/Fringale/followers","following_url":"https://api.github.com/users/Fringale/following{/other_user}","gists_url":"https://api.github.com/users/Fringale/gists{/gist_id}","starred_url":"https://api.github.com/users/Fringale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fringale/subscriptions","organizations_url":"https://api.github.com/users/Fringale/orgs","repos_url":"https://api.github.com/users/Fringale/repos","events_url":"https://api.github.com/users/Fringale/events{/privacy}","received_events_url":"https://api.github.com/users/Fringale/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-02T19:19:00Z","updated_at":"2016-06-08T09:19:33Z","closed_at":null,"body":"#### Issue details\r\nOn desktop, when using a keyboard that has more character keys than the US one, the keyDown() callback gives a keycode of 0 (UNKNOWN) for those few additional keys. A workaround to use them still would be to check keyTyped() in conjunction, but this is not ideal.\r\n\r\nIn my case, on an AZERTY (French) Macbook Pro (see layout [here](https://images-na.ssl-images-amazon.com/images/I/71AzlASSbTL._SL1500_.jpg), it has one extra character key compared to an US keyboard), the top-left _#@_ key gets the UNKNOWN keycode treatment (GRAVE being the bottom left _<>_). Other reports of this behavior may include this [old issue](https://github.com/libgdx/libgdx/issues/2263#issuecomment-53264980), and this recent [forum post](http://www.badlogicgames.com/forum/viewtopic.php?f=11&t=22724).\r\n\r\nUnder the hood, for my _#@_ example, the LWJGL 2 and 3 backends each actually report a specific keycode,  but those keycodes get map to UNKNOWN in LwjglInput / Lwjgl3Input as they have no equivalent in Input.Keys:\r\n- LWJGL3 gives [GLFW_KEY_WORLD_1](http://www.glfw.org/docs/latest/group__keys.html) for this _#@_ key,\r\n- while LWJGL2 returns a quite unrelated [KEY_SECTION](http://legacy.lwjgl.org/javadoc/constant-values.html#org.lwjgl.input.Keyboard.KEY_SECTION) (for a hypothetical _§_ key I suppose).\r\n\r\nI don’t think the LWJGL2 case is worth taking a look at, as the backend will be phased out, plus a solution could prove ugly to implement if there’s a wide list of possible additional keycodes.\r\n\r\nHowever, regarding the LWJGL3 backend, GLFW seems to provide just two keycodes specifically for this use case (GLFW_KEY_WORLD_1 and GLFW_KEY_WORLD_2). **As such, could two equivalent keycodes be added in Input.Keys and mapped adequately in the LWJGL3 backend?**\r\n\r\n#### Reproduction steps/code\r\n- Have a non-US keyboard with additional character keys\r\n- Find the key(s) returning 0 with this code and some key mashing : )\r\n```\r\npackage com.mygdx.game;\r\n\r\nimport com.badlogic.gdx.*;\r\n\r\npublic class MyGdxGame extends InputAdapter implements ApplicationListener {\r\n\r\n\t@Override\r\n\tpublic void create () {\r\n\t\tGdx.input.setInputProcessor(this);\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void render () {\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void resize(int width, int height) {\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void pause() {\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void resume() {\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void dispose() {\r\n\t}\r\n\r\n\t@Override\r\n\tpublic boolean keyDown(int keycode) {\r\n\t\tSystem.out.println(keycode);\r\n\t\treturn true;\r\n\t}\r\n}\r\n```\r\n\r\n#### Version of LibGDX and/or relevant dependencies\r\n1.9.3\r\n\r\n#### Please select the affected platforms\r\n- [ ] Android\r\n- [ ] iOS (robovm)\r\n- [ ] iOS (MOE)\r\n- [ ] HTML/GWT\r\n- [X] Windows\r\n- [X] Linux\r\n- [x] MacOS\r\n\r\n_(I only did test on OS X, though)_"},"comment":{"url":"https://api.github.com/repos/libgdx/libgdx/issues/comments/224535003","html_url":"https://github.com/libgdx/libgdx/issues/4119#issuecomment-224535003","issue_url":"https://api.github.com/repos/libgdx/libgdx/issues/4119","id":224535003,"user":{"login":"RoyBeer","id":16647738,"avatar_url":"https://avatars.githubusercontent.com/u/16647738?v=3","gravatar_id":"","url":"https://api.github.com/users/RoyBeer","html_url":"https://github.com/RoyBeer","followers_url":"https://api.github.com/users/RoyBeer/followers","following_url":"https://api.github.com/users/RoyBeer/following{/other_user}","gists_url":"https://api.github.com/users/RoyBeer/gists{/gist_id}","starred_url":"https://api.github.com/users/RoyBeer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RoyBeer/subscriptions","organizations_url":"https://api.github.com/users/RoyBeer/orgs","repos_url":"https://api.github.com/users/RoyBeer/repos","events_url":"https://api.github.com/users/RoyBeer/events{/privacy}","received_events_url":"https://api.github.com/users/RoyBeer/received_events","type":"User","site_admin":false},"created_at":"2016-06-08T09:19:33Z","updated_at":"2016-06-08T09:19:33Z","body":"This is also an issue on Windows and Ubuntu 16.04 with a German QWERTY Keyboard."}}
{"actor":{"display_login":"RoyBeer"}}