Closed Sorunome closed 2 months ago
Could you try $ fusuma-sendkey LEFTCTRL+T
on terminal?
i tried that as sleep 3 && fusuma-sendkey LEFTCTRL+T
so that i have time to switch to firefox, but also no keys were triggered
Do you have any errors in terminal?
Please update fusuma and all fusuma-plugins. (I noticed you are using fusuma v2.3.0)
Seems like the AUR for fusuma was slightly out-of-date then. Anyhow, I updated fusuma and its plugins:
fusuma (2.4.1, 2.3.0)
fusuma-plugin-sendkey (0.6.4)
fusuma-plugin-wmctrl (1.1.0)
sadly the same issue still persists, and there is no error or output at all in the terminal.
Possibly worth noting is that I am on an M1 macbook with asahi linux, however since xorg seems to be working fine and the other plugin works, sendkey should maybe also work? I'm not too sure how this stuff works internally ^^"
I believe fusuma-plugin-sendkey will work in your environment.
Fusuma sendkey sends events using evdev protocol. Evdev is generic event protocol for Linux input devices. So your real Apple keyboard should also send key events using evdev.
You can see the raw events of evdev in $ cat /dev/input/eventXX
. (device file, XX is auto-assigned number)
Also, since libinput uses evdev as its source, it is useful to know keys code and event device's number sent by libinput debug-events --show-keycodes
or libinput list-devices
event3 is my keyboard device number, /dev/inputs/event3 is device file. fusuma-sendkey writes key events to event device (/dev/inputs/event3), it behaves like real keyboard events.
Could you paste output of libinput list-devices
and libinput debug-events --show-keycodes
?
I had a similar problem, and after expending the better part of yesterday investigating the cause, I found something that may be useful for @Sorunome or anyone else that comes across a similar issue.
A little bit of backstory first (go to the end for the solution):
I had been using Fusuma for a while without problems, but when I changed my laptop it stopped working altogether. The main Fusuma process and fusuma-sendkey both started without any errors, but the keypresses were not being sent.
So after googling for an answer and not finding any, I decided to download this repo and debug a little bit what was happening. With the repo on one side and libinput list-devices
on the other, I found that fusuma-sendkey sends the keycodes to the first device that matches a keyboard regex and on my system there were 3(!) of them.
This finding led me to manually set other inputs (such as input/event5
) and run fusuma-sendkey with it. And it worked!
Afterwards, I went into a rabbit hole of documentation and blogposts talking about inputs and udev rules that led me nowhere. I tried to rename the input (not possible) and later to remove it completely (or at least not recognized by libinput).
But I discovered something: certain keys were only being handled by input/event4 and others by input/event5 and some of them by both!. For example, KEY_KBDILLUMUP
worked only on event4, any alphabet letter only on event5 and KEY_F21
on both.
With this newfound knowledge, I remembered other tools that I had tried before and worked, such as ydotool. Ydotool is set up a little differently in that it requires a constantly running daemon to function. Looking into its code I found that it was creating a new virtual input device when starting the daemon.
So my solution was to create a dummy virtual keyboard and configure it in fusuma.yml (sendkey_executor:device_name
) to point to that device.
For that, I made a simple console tool that can be run as a daemon to create a virtual keyboard.
@fneirotti that is a great answer, it helped me find a solution. Thanks a lot!
Running 'libinput list-devices' displays all devices, then I tried a different one that seemd like a keyboard.
plugin:
executors:
sendkey_executor:
device_name: 'AT Translated Set 2 keyboard'
swipe
3: ........
that really helped @fneirotti. thenks i think this should be included in readme. laptop devices often have multiple "keyboard" type devices and the plugin seems to pick whichever is the first ( as in output of libinput list-devices), therefore not being able to to do anything
fusuma-plugin-remap is still in development and experimental, but it can be used alongside fusuma-plugin-sendkey. When you install fusuma-plugin-remap, fusuma creates a dedicated virtual keyboard and fusuma-plugin-sendkey use it automatically. This eliminates the need to manually specify a keyboard in yaml, simplifying the setup process.
By installing fusuma-plugin-remap, a virtual device will be automatically created.
$ libinput list-devices
...
Device: fusuma_virtual_keyboard
Kernel: /dev/input/event14
Group: 12
Seat: seat0, default
Capabilities: keyboard pointer
Tap-to-click: n/a
Tap-and-drag: n/a
Tap drag lock: n/a
Left-handed: disabled
Nat.scrolling: disabled
Middle emulation: disabled
Calibration: n/a
Scroll methods: button
Click methods: none
Disable-w-typing: n/a
Disable-w-trackpointing: n/a
Accel profiles: flat *adaptive custom
Rotation: 0.0
Fusuma will use fusuma_virtual_keyboard if found it. This will be the default for future versions of Fusuma. If you still encounter issues after setting up fusuma-plugin-remap, please let us know again.
Using awesome WM, the sendkey plugin seems to be doing nothing.
Here is the
~/.config/fusuma/config.yml
:The logging does show e.g.
I, [2022-05-30T14:59:57.270877 #30258] INFO -- : {:sendkey=>"LEFTCTRL+T"}
, however e.g. firefox does not open a new tab.The output of
fusuma -l
is:Any help or advice would be greatly appreciated