Skip to content

Batching of key events drops events #452

@hadronized

Description

@hadronized

I found an annoying bug with bemenu on Wayland that only occurs with my bluetooth keyboard if not wired. Batching of keys at the BLE level causes bemenu to ignore the first key if the events come as press, press, released, released.

I tried to look at the code in lib/renderers/wayland/* to check how keys are handled, and so far I have been unsuccessful, but I can always replicate the bug. Using a bluetooth keyboard, pressing two keys st with the following scheme:

s: press
t: press
s: release
t: release

At the firmware level, those events are batched because I have something called tap-mode on them, I guess — it doesn’t happen with regular keys. The important part is that those keys are often batched at the bluetooth level and so the host — Wayland here — gets batched events.

I compared what happens with wev between a wired and wireless keyboard, and basically, the timestamps on the events are oftentimes batched on the wireless version (so several events have the same one). I am not sure how that affects wayland and its keyboard layer, but I definitely see a difference between bemenu and other wayland applications I use. I suspect the implementation to drop events.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions