Skip to content
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

[3.x] Allow for mapping scancodes to current layout #56015

Merged
merged 1 commit into from
Jan 16, 2022

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Dec 17, 2021

Backport of #52684 for 3.x

Adds OS.keyboard_get_scancode_from_physical(scancode) function.

Implements godotengine/godot-proposals#3571 for 3.x

Test project: phy_conv3.zip

@akien-mga akien-mga merged commit 879244c into godotengine:3.x Jan 16, 2022
@akien-mga
Copy link
Member

Thanks!

@jitspoe
Copy link
Contributor

jitspoe commented Jan 20, 2022

Sweet! Seems to work. Just in time for Steam Next Fest!

jitspoe pushed a commit to jitspoe/godot that referenced this pull request Jan 20, 2022
@Exerionius
Copy link

Was this ever ported to 4.x ?

I can't seem to find a way to convert physical keycode to a regular one

@jitspoe
Copy link
Contributor

jitspoe commented Nov 15, 2023

Haha, I just got the documentation for that fixed: https://github.com/godotengine/godot/pull/82092/files

		    if event is InputEventKey:
			        var keycode = DisplayServer.keyboard_get_keycode_from_physical(event.physical_keycode)
			        print(OS.get_keycode_string(keycode))

@AThousandShips
Copy link
Member

Was this ever ported to 4.x ?

This was from 4.x, it already existed in 4.x and was backported to 3.x, see the description

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants