rustrogueliketutorial icon indicating copy to clipboard operation
rustrogueliketutorial copied to clipboard

Cannot go downstairs (keyboard input problem on Linux)

Open mgedmin opened this issue 4 years ago • 2 comments

I'm unable to go downstairs in e.g. cargo run inside chapter-21-rexmenu.

My experiments with glutin's cargo run --example window show that when I press the period key on my keyboard, the events look like this:

WindowEvent { window_id: WindowId(Wayland(WindowId(94351912379904))), event: KeyboardInput { device_id: DeviceId(Wayland(DeviceId)), input: KeyboardInput { scancode: 52, state: Pressed, virtual_keycode: None, modifiers: ModifiersState { shift: false, ctrl: false, alt: false, logo: false } } } }
WindowEvent { window_id: WindowId(Wayland(WindowId(94351912379904))), event: ReceivedCharacter('.') }

I've no idea why virtual_keycode is None. Bug in glutin maybe?

I'm wondering if maybe ReceivedCharacter would be a better event to use for character-based input commands? Might it work better for people using non-QWERTY keyboard layouts? (I wonder how Dvorak users like to play roguelikes?)

mgedmin avatar Sep 17 '19 06:09 mgedmin

That sounds like an issue between winit and Wayland; I'll see what I can find. What keyboard locale do you use?

thebracket avatar Sep 17 '19 20:09 thebracket

"Lithuanian (US, with Lithuanian letters)", which is basically stock US English except the right Alt is an AltGr and I get ąčęėįšųūž on AltGr+1,2,3,...,8,=.

mgedmin avatar Sep 18 '19 07:09 mgedmin