iberianpig / fusuma-plugin-sendkey

Fusuma plugin that sending virtual keyboard events
MIT License
70 stars 1 forks source link

sendkey: Keyboard: /keyboard|Keyboard|KEYBOARD/ is not found #16

Closed mike-lloyd03 closed 2 days ago

mike-lloyd03 commented 3 years ago

I've been using fusuma for a few months now with no issues. But about a week ago, I had a crash related to baloo_file_extractor and ever since then, fusuma has been hit or miss. I normally have it start on login with an autostart script. But sometimes it just doesn't work. Running fusuma manually at the command line returns:

I, [2021-02-10T20:25:29.245877 #3605]  INFO -- : reload config: /home/mike/.config/fusuma/config.yml
I, [2021-02-10T20:25:29.280140 #3605]  INFO -- : ---------------------------------------------
I, [2021-02-10T20:25:29.280165 #3605]  INFO -- : Fusuma: 1.11.1
I, [2021-02-10T20:25:29.280557 #3605]  INFO -- : libinput: 1.16.4
I, [2021-02-10T20:25:29.280892 #3605]  INFO -- : OS: Linux 5.10.13-2-MANJARO #1 SMP PREEMPT Sat Feb 6 10:28:21 UTC 2021
I, [2021-02-10T20:25:29.281208 #3605]  INFO -- : Distribution: Manjaro Linux \r  (\n) (\l)
I, [2021-02-10T20:25:29.282854 #3605]  INFO -- : Desktop session: /usr/share/xsessions/plasma x11
I, [2021-02-10T20:25:29.282866 #3605]  INFO -- : ---------------------------------------------
I, [2021-02-10T20:25:29.282873 #3605]  INFO -- : Enabled Plugins: 
I, [2021-02-10T20:25:29.282926 #3605]  INFO -- :   Fusuma::Plugin::Buffers::GestureBuffer
I, [2021-02-10T20:25:29.282948 #3605]  INFO -- :   Fusuma::Plugin::Buffers::KeypressBuffer
I, [2021-02-10T20:25:29.282953 #3605]  INFO -- :   Fusuma::Plugin::Detectors::KeypressDetector
I, [2021-02-10T20:25:29.282957 #3605]  INFO -- :   Fusuma::Plugin::Detectors::PinchDetector
I, [2021-02-10T20:25:29.282961 #3605]  INFO -- :   Fusuma::Plugin::Detectors::RotateDetector
I, [2021-02-10T20:25:29.282965 #3605]  INFO -- :   Fusuma::Plugin::Detectors::SwipeDetector
I, [2021-02-10T20:25:29.282969 #3605]  INFO -- :   Fusuma::Plugin::Events::Records::GestureRecord
I, [2021-02-10T20:25:29.282976 #3605]  INFO -- :   Fusuma::Plugin::Events::Records::IndexRecord
I, [2021-02-10T20:25:29.283002 #3605]  INFO -- :   Fusuma::Plugin::Events::Records::KeypressRecord
I, [2021-02-10T20:25:29.283007 #3605]  INFO -- :   Fusuma::Plugin::Events::Records::TextRecord
I, [2021-02-10T20:25:29.283029 #3605]  INFO -- :   Fusuma::Plugin::Executors::CommandExecutor
I, [2021-02-10T20:25:29.283057 #3605]  INFO -- :   Fusuma::Plugin::Executors::SendkeyExecutor
I, [2021-02-10T20:25:29.283062 #3605]  INFO -- :   Fusuma::Plugin::Filters::KeypressFilter
I, [2021-02-10T20:25:29.283068 #3605]  INFO -- :   Fusuma::Plugin::Filters::LibinputDeviceFilter
I, [2021-02-10T20:25:29.283072 #3605]  INFO -- :   Fusuma::Plugin::Filters::LibinputTimeoutFilter
I, [2021-02-10T20:25:29.283092 #3605]  INFO -- :   Fusuma::Plugin::Inputs::LibinputCommandInput
I, [2021-02-10T20:25:29.283096 #3605]  INFO -- :   Fusuma::Plugin::Parsers::KeypressParser
I, [2021-02-10T20:25:29.283101 #3605]  INFO -- :   Fusuma::Plugin::Parsers::LibinputGestureParser
I, [2021-02-10T20:25:29.283106 #3605]  INFO -- : ---------------------------------------------

After doing a three finger swipe I get:

sendkey: Keyboard: /keyboard|Keyboard|KEYBOARD/ is not found

and the program terminates.

Other times, however, fusuma seems to run normally and I can't quite figure out what the cause is. In fact, I just tried it again right now and it works. But other times, I get nothing.

One thing I noticed is that libinput seems to think I have a bluetooth keyboard connected (M720 Triathalon Keyboard) but I only have a bluetooth mouse connected.

$ libinput list-devices

Device:           Power Button
Kernel:           /dev/input/event2
Group:            1
Seat:             seat0, default
Capabilities:     keyboard 
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      n/a
Nat.scrolling:    n/a
Middle emulation: n/a
Calibration:      n/a
Scroll methods:   none
Click methods:    none
Disable-w-typing: n/a
Accel profiles:   n/a
Rotation:         n/a

Device:           Video Bus
Kernel:           /dev/input/event4
Group:            2
Seat:             seat0, default
Capabilities:     keyboard 
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      n/a
Nat.scrolling:    n/a
Middle emulation: n/a
Calibration:      n/a
Scroll methods:   none
Click methods:    none
Disable-w-typing: n/a
Accel profiles:   n/a
Rotation:         n/a

Device:           Video Bus
Kernel:           /dev/input/event5
Group:            2
Seat:             seat0, default
Capabilities:     keyboard 
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      n/a
Nat.scrolling:    n/a
Middle emulation: n/a
Calibration:      n/a
Scroll methods:   none
Click methods:    none
Disable-w-typing: n/a
Accel profiles:   n/a
Rotation:         n/a

Device:           Lid Switch
Kernel:           /dev/input/event0
Group:            3
Seat:             seat0, default
Capabilities:     switch
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      n/a
Nat.scrolling:    n/a
Middle emulation: n/a
Calibration:      n/a
Scroll methods:   none
Click methods:    none
Disable-w-typing: n/a
Accel profiles:   n/a
Rotation:         n/a

Device:           Power Button
Kernel:           /dev/input/event1
Group:            4
Seat:             seat0, default
Capabilities:     keyboard 
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      n/a
Nat.scrolling:    n/a
Middle emulation: n/a
Calibration:      n/a
Scroll methods:   none
Click methods:    none
Disable-w-typing: n/a
Accel profiles:   n/a
Rotation:         n/a

Device:           Integrated Camera: Integrated C
Kernel:           /dev/input/event16
Group:            5
Seat:             seat0, default
Capabilities:     keyboard 
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      n/a
Nat.scrolling:    n/a
Middle emulation: n/a
Calibration:      n/a
Scroll methods:   none
Click methods:    none
Disable-w-typing: n/a
Accel profiles:   n/a
Rotation:         n/a

Device:           Integrated Camera: Integrated I
Kernel:           /dev/input/event18
Group:            5
Seat:             seat0, default
Capabilities:     keyboard 
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      n/a
Nat.scrolling:    n/a
Middle emulation: n/a
Calibration:      n/a
Scroll methods:   none
Click methods:    none
Disable-w-typing: n/a
Accel profiles:   n/a
Rotation:         n/a

Device:           Razer Razer Blade
Kernel:           /dev/input/event15
Group:            6
Seat:             seat0, default
Capabilities:     keyboard 
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      n/a
Nat.scrolling:    n/a
Middle emulation: n/a
Calibration:      n/a
Scroll methods:   none
Click methods:    none
Disable-w-typing: n/a
Accel profiles:   n/a
Rotation:         n/a

Device:           Razer Razer Blade
Kernel:           /dev/input/event17
Group:            6
Seat:             seat0, default
Capabilities:     keyboard pointer 
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      n/a
Nat.scrolling:    disabled
Middle emulation: n/a
Calibration:      n/a
Scroll methods:   none
Click methods:    none
Disable-w-typing: n/a
Accel profiles:   n/a
Rotation:         n/a

Device:           Razer Razer Blade
Kernel:           /dev/input/event19
Group:            6
Seat:             seat0, default
Capabilities:     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
Accel profiles:   flat *adaptive
Rotation:         n/a

Device:           ELAN0406:00 04F3:30A6 Touchpad
Kernel:           /dev/input/event7
Group:            7
Seat:             seat0, default
Size:             125x77mm
Capabilities:     pointer gesture
Tap-to-click:     disabled
Tap-and-drag:     enabled
Tap drag lock:    disabled
Left-handed:      disabled
Nat.scrolling:    disabled
Middle emulation: disabled
Calibration:      n/a
Scroll methods:   *two-finger edge 
Click methods:    *button-areas clickfinger 
Disable-w-typing: enabled
Accel profiles:   flat *adaptive
Rotation:         n/a

Device:           ELAN0406:00 04F3:30A6 Mouse
Kernel:           /dev/input/event6
Group:            7
Seat:             seat0, default
Capabilities:     pointer 
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      disabled
Nat.scrolling:    disabled
Middle emulation: n/a
Calibration:      n/a
Scroll methods:   *button
Click methods:    none
Disable-w-typing: n/a
Accel profiles:   flat *adaptive
Rotation:         n/a

Device:           M720 Triathlon Keyboard
Kernel:           /dev/input/event20
Group:            8
Seat:             seat0, default
Capabilities:     keyboard 
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      n/a
Nat.scrolling:    n/a
Middle emulation: n/a
Calibration:      n/a
Scroll methods:   none
Click methods:    none
Disable-w-typing: n/a
Accel profiles:   n/a
Rotation:         n/a

Device:           M720 Triathlon Mouse
Kernel:           /dev/input/event21
Group:            8
Seat:             seat0, default
Capabilities:     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
Accel profiles:   flat *adaptive
Rotation:         n/a
iberianpig commented 3 years ago

Hi @mike-lloyd03

One thing I noticed is that libinput seems to think I have a bluetooth keyboard connected (M720 Triathalon Keyboard) but I only have a bluetooth mouse connected.

mike-lloyd03 commented 3 years ago

I only have a Bluetooth mouse connected. I have never connected a Bluetooth keyboard. I'm expecting the built in keyboard (this is a laptop) to be recognized. I see three "Razer Razer Blade" devices in the devices list, two of which have keyboard capability.

iberianpig commented 3 years ago

If you know the keyboard device name and listed in libinput list-devices, please try the following configuration.

https://github.com/iberianpig/fusuma-plugin-sendkey#specify-keyboard-by-device-name

plugin:
executors:
sendkey_executor:
device_name: 'YOUR KEYBOARD NAME'
mike-lloyd03 commented 3 years ago

That seems to be working for now. I'll follow up if things change. Sorry I missed this in the readme.

Thanks so much.

mike-lloyd03 commented 3 years ago

So I'm still having issues with Fusuma after waking from sleep. The daemon is still running but it's not detecting any inputs. I think the issue might be related to having multiple devices with the same name. libinput shows three devices named 'Razer Razer Blade'. Can I specify the device by another identifier? /dev/input/event15 is the device location for my keyboard.

iberianpig commented 3 years ago

You're right, it might be difficult to identify if there are multiple devices with the same name. However, the device ID may change at startup, so it shouldn't depend on device ID.

For now, I'll try to reproduce the problem and determine a solution with test code.

mike-lloyd03 commented 3 years ago

Sounds good. Thank you.

iberianpig commented 2 days ago

It seems that installing the fusuma-plugin-remap may help resolve this issue by automatically creating a virtual device. You can find more information here: https://github.com/iberianpig/fusuma-plugin-remap.

If you continue to experience problems, please let us know.