WayfireWM / wayfire

A modular and extensible wayland compositor
https://wayfire.org/
MIT License
2.35k stars 174 forks source link

wtype didn't work in Wayfire (when using as a Key board shortcut) #2405

Open liumingedwin opened 1 month ago

liumingedwin commented 1 month ago

Describe the bug Usually, wtype uses some Wayland keyboard protocol to emulate the Key down actions. However, it didn't work in wayfire but it's okay to type texts.

To Reproduce Steps to reproduce the behavior:

  1. Latest wayfire, wtype.
  2. Some keyboard shortcut set(e.g. W-1)
  3. wtype -M logo -P 1 -s 1

Expected behavior Shortcut triggered.

Wayfire version 0.8.1, Debian Trixie

killown commented 1 month ago

just in case you are wondering if there is alternatives, you could use IPC https://github.com/killown/waypy

for example if you want to trigger a shortcut ALT+E sock.press_key("A-KEY_E")

ammen99 commented 1 month ago

Wtype uses different key codes with a custom mapping. By default bindings in Wayfire are based on hardware keycodes so that's where the confusion comes from.

As a workaround, you can try using the xkb-shortcuts plugin available in the latest git version. With it, I think that shortcuts ought to work with wtype (you'll have to update the config file though to use keysyms for bindings). Related: #1601 , #2247