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

Incorrect virtual_keycode for numpad key presses on macOS #2002

Closed
wtfleming opened this issue Aug 20, 2021 · 1 comment
Closed

Incorrect virtual_keycode for numpad key presses on macOS #2002

wtfleming opened this issue Aug 20, 2021 · 1 comment
Labels
B - bug Dang, that shouldn't have happened DS - macos

Comments

@wtfleming
Copy link

I'm using winit 0.25.0 and macOS 11.5.2

When I run cargo run --example window | grep KeyboardInput

And I press the 8 key I get this output:

WindowEvent { window_id: WindowId(Id(140618894547696)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 28, state: Released, virtual_keycode: Some(Key8), modifiers: (empty) }, is_synthetic: false } }

I press the numpad 8 key:

WindowEvent { window_id: WindowId(Id(140618894547696)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 91, state: Released, virtual_keycode: Some(Key8), modifiers: (empty) }, is_synthetic: false } }

I press the NumpadEnter key:

WindowEvent { window_id: WindowId(Id(140618894547696)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 76, state: Released, virtual_keycode: Some(NumpadEnter), modifiers: (empty) }, is_synthetic: false } }

The scancodes look correct, but the virtual_keycode for numpad8 is coming back as Some(Key8), when I would expect it to be Some(Numpad8)

I was seeing this issue trying to get the numpad input working in bracket-lib here amethyst/bracket-lib#222
And it looks like someone using Bevy is seeing something similar bevyengine/bevy#1666

@maroider maroider added DS - macos B - bug Dang, that shouldn't have happened labels Aug 21, 2021
@maroider
Copy link
Member

maroider commented Aug 21, 2021

Thanks for taking the time to report your issue. We're aware of this problem, and a fix exists in #1890.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B - bug Dang, that shouldn't have happened DS - macos
Development

No branches or pull requests

3 participants