Skip to content

Mouse buttons to toggle push2talk? #21

@henesy

Description

@henesy

Trying to figure out if it's currently possible and I'm missing something or if this wouldn't work with how push2talk monitors for keyboard events.

Ideally, the end goal is to use a side button on a wireless mouse being held as the trigger to unmute the microphone, with releasing the mouse button resulting in muting the microphone.

Trying to set either extra, BTN_EXTRA (from evtest), or 276 in PUSH2TALK_KEYBIND results in:

[2025-12-20T07:43:25Z ERROR push2talk] Error in thread 'libinput': "Unable to parse keybind"

I took a peek inside

fn parse_keybind() -> Result<Vec<Keysym>, Box<dyn Error>> {
and saw that the parsing for the environment variable expects a keysym.

Specifically, I think mouse button presses are exposed as pointer events rather than keyboard events and mouse buttons may not have xkb keysyms associated with them.

For reference, this is what wev shows for a mouse button event:

[13:      wl_pointer] button: serial: 51163; time: 17158058; button: 276 (extra), state: 0 (released)
[13:      wl_pointer] frame
[13:      wl_pointer] button: serial: 51164; time: 17158337; button: 276 (extra), state: 1 (pressed)
[13:      wl_pointer] frame
[13:      wl_pointer] button: serial: 51165; time: 17158463; button: 276 (extra), state: 0 (released)
[13:      wl_pointer] frame

Compared to a keyboard event with a keysym shown for the name:

[14:     wl_keyboard] key: serial: 51166; time: 17158673; key: 64; state: 1 (pressed)
                      sym: Alt_L        (65513), utf8: ''

I'm not familiar with wayland or x11 underpinnings so I very well could be missing something obvious, sorry about that.

Happy to provide any information I can to help.

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