Skip to content

No virtual keycodes on Wayland #1533

@lovesegfault

Description

@lovesegfault

I found this issue while playing around with crow but I can reproduce it with the window example too. Basically, keypresses get recorded, and they have a scancode, but their virtual_keycode is always None.

Some logs:

WindowEvent { window_id: WindowId(Wayland(WindowId(94246364294192))), event: KeyboardInput { device_id: DeviceId(Wayland(DeviceId)), input: KeyboardInput { scancode: 37, state: Pressed, virtual_keycode: None, modifiers: (empty) }, is_synthetic: false } }
MainEventsCleared
RedrawEventsCleared
NewEvents(WaitCancelled { start: Instant { tv_sec: 41322, tv_nsec: 458777736 }, requested_resume: None })
MainEventsCleared
RedrawEventsCleared
NewEvents(WaitCancelled { start: Instant { tv_sec: 41322, tv_nsec: 528815100 }, requested_resume: None })
WindowEvent { window_id: WindowId(Wayland(WindowId(94246364294192))), event: KeyboardInput { device_id: DeviceId(Wayland(DeviceId)), input: KeyboardInput { scancode: 38, state: Released, virtual_keycode: None, modifiers: (empty) }, is_synthetic: false } }
WindowEvent { window_id: WindowId(Wayland(WindowId(94246364294192))), event: KeyboardInput { device_id: DeviceId(Wayland(DeviceId)), input: KeyboardInput { scancode: 35, state: Pressed, virtual_keycode: None, modifiers: (empty) }, is_synthetic: false } }
MainEventsCleared
RedrawEventsCleared
NewEvents(WaitCancelled { start: Instant { tv_sec: 41322, tv_nsec: 529053870 }, requested_resume: None })
MainEventsCleared
RedrawEventsCleared
NewEvents(WaitCancelled { start: Instant { tv_sec: 41322, tv_nsec: 565722252 }, requested_resume: None })
WindowEvent { window_id: WindowId(Wayland(WindowId(94246364294192))), event: KeyboardInput { device_id: DeviceId(Wayland(DeviceId)), input: KeyboardInput { scancode: 37, state: Released, virtual_keycode: None, modifiers: (empty) }, is_synthetic: false } }
WindowEvent { window_id: WindowId(Wayland(WindowId(94246364294192))), event: KeyboardInput { device_id: DeviceId(Wayland(DeviceId)), input: KeyboardInput { scancode: 36, state: Pressed, virtual_keycode: None, modifiers: (empty) }, is_synthetic: false } }
MainEventsCleared
RedrawEventsCleared
NewEvents(WaitCancelled { start: Instant { tv_sec: 41322, tv_nsec: 566021425 }, requested_resume: None })
MainEventsCleared
RedrawEventsCleared
NewEvents(WaitCancelled { start: Instant { tv_sec: 41322, tv_nsec: 596426265 }, requested_resume: None })
WindowEvent { window_id: WindowId(Wayland(WindowId(94246364294192))), event: KeyboardInput { device_id: DeviceId(Wayland(DeviceId)), input: KeyboardInput { scancode: 36, state: Released, virtual_keycode: None, modifiers: (empty) }, is_synthetic: false } }
MainEventsCleared
RedrawEventsCleared
NewEvents(WaitCancelled { start: Instant { tv_sec: 41322, tv_nsec: 596666823 }, requested_resume: None })
MainEventsCleared
RedrawEventsCleared
NewEvents(WaitCancelled { start: Instant { tv_sec: 41322, tv_nsec: 619346603 }, requested_resume: None })
WindowEvent { window_id: WindowId(Wayland(WindowId(94246364294192))), event: KeyboardInput { device_id: DeviceId(Wayland(DeviceId)), input: KeyboardInput { scancode: 35, state: Released, virtual_keycode: None, modifiers: (empty) }, is_synthetic: false } }
MainEventsCleared
RedrawEventsCleared
NewEvents(WaitCancelled { start: Instant { tv_sec: 41322, tv_nsec: 619561642 }, requested_resume: None })
MainEventsCleared
RedrawEventsCleared
NewEvents(WaitCancelled { start: Instant { tv_sec: 41323, tv_nsec: 115135826 }, requested_resume: None })
WindowEvent { window_id: WindowId(Wayland(WindowId(94246364294192))), event: KeyboardInput { device_id: DeviceId(Wayland(DeviceId)), input: KeyboardInput { scancode: 125, state: Pressed, virtual_keycode: None, modifiers: (empty) }, is_synthetic: false } }
MainEventsCleared
RedrawEventsCleared
NewEvents(WaitCancelled { start: Instant { tv_sec: 41323, tv_nsec: 115397555 }, requested_resume: None })
MainEventsCleared
RedrawEventsCleared
NewEvents(WaitCancelled { start: Instant { tv_sec: 41323, tv_nsec: 156314949 }, requested_resume: None })
WindowEvent { window_id: WindowId(Wayland(WindowId(94246364294192))), event: KeyboardInput { device_id: DeviceId(Wayland(DeviceId)), input: KeyboardInput { scancode: 42, state: Pressed, virtual_keycode: None, modifiers: (empty) }, is_synthetic: false } }
MainEventsCleared
RedrawEventsCleared
NewEvents(WaitCancelled { start: Instant { tv_sec: 41323, tv_nsec: 156535102 }, requested_resume: None })
MainEventsCleared
RedrawEventsCleared
NewEvents(WaitCancelled { start: Instant { tv_sec: 41323, tv_nsec: 212117666 }, requested_resume: None })
WindowEvent { window_id: WindowId(Wayland(WindowId(94246364294192))), event: CloseRequested }
MainEventsCleared
RedrawEventsCleared
LoopDestroyed

Metadata

Metadata

Assignees

No one assigned

    Labels

    B - bugDang, that shouldn't have happenedC - in progressImplementation is proceeding smoothlyDS - waylandAffects the Wayland backend, or generally free Unix platforms

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions