Rush / wayland-push-to-talk-fix

This fixes the inability to use push to talk in Discord when running Wayland
MIT License
50 stars 13 forks source link

Using Mouse Keys Instead of Keyboard Keys #2

Open bmearnhardt opened 1 year ago

bmearnhardt commented 1 year ago

It's probably more common to use keyboards instead of mouse keys for push-to-talk. but I do have a mouse with the extra keys on the side. I know they are bound to forward and back as I use the forward key for PTT on X11. I don't know much about the Linux key code system and was wondering if it was possible to use a mouse instead? I have the Logitech G900 for reference.

I tried with the forward key from the key code links but I only got a "This device is not capable of sending this key code" message.

ckx commented 1 year ago

I'm also interested in using a mouse for PTT. Is this something this codebase can be adapted to do easily?

Rush commented 1 year ago

Yes. PRs welcome:)

hypevhs commented 10 months ago

I have a Razer Naga Pro v1. I bound the first macro key to "F13"... and apparently the XF86 key for that is "Tools". The linux driver exposes two keyboards. The if01 one doesn't seem to do anything for me, but the if02 one will send F13 just fine.

sudo ./push-to-talk -v /dev/input/by-id/usb-1532_Razer_Naga_Pro_000000000000-if02-event-kbd -k KEY_F13 -n XF86Tools

ckx commented 8 months ago

I took a quick look at enabling mouse keys in the source, but the brain dead approaches I tried didn't pan out, so I ended up doing something similar to @libjared.

Since I use all my mouse buttons on a regular basis (but not necessarily while gaming with friends on voice), I ended up creating a second profile on my mouse with M5 set to a key I don't use, edited the PTT_XKEY_EVENT definition in the cpp file, rebuilt, and set an alias:

alias ptt="sudo /home/ckx/repos/wayland-push-to-talk-fix/push-to-talk /dev/input/by-id/usb-Razer_Razer_Basilisk_V3-if02-event-kbd"

This works good enough for me, but it would still be nice to have support for mouse buttons in the source.

Rush commented 8 months ago

Ironically, I also made some in-source changes for a new use-case I have. :-) All good! Glad the base source is useful enough to make modifications easily.