Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use touchpad while keyd is running #42

Closed
suderman opened this issue Nov 10, 2021 · 16 comments
Closed

Can't use touchpad while keyd is running #42

suderman opened this issue Nov 10, 2021 · 16 comments

Comments

@suderman
Copy link

I'm using the AUR package on my Framework laptop, and whenever the keyd service is running, the touchpad doesn't work at all. After stopping keyd, I can move my cursor again. Am I doing it wrong?

Env

  • Arch Linux rolling
  • SwayWM
  • Framework laptop
pacman -Q keyd-git
keyd-git 1.1.2.r23.c7ee833-1

Config

cat /etc/keyd/AT\ Translated\ Set\ 2\ keyboard.cfg
capslock = overload(C, esc)

Output

sudo keyd
Starting keyd v1.1.2 (c7ee83350dc0064e9f03a780995efce18266ea4d).
Managing AT Translated Set 2 keyboard

...at this point, there is no more output and it's impossible to move the cursor or click any buttons with the touchpad.

@rvaiya
Copy link
Owner

rvaiya commented Nov 10, 2021 via email

@rvaiya
Copy link
Owner

rvaiya commented Nov 10, 2021

Sorry, ignore my last message. The machine I was looking at the logs on had outdated history. You are indeed running the latest commit. The logs are the only thing I need.

@suderman
Copy link
Author

➜  ~ sudo keyd -v
keyd version: 1.1.2 (c7ee83350dc0064e9f03a780995efce18266ea4d)
➜  ~ sudo journalctl -b -u keyd
-- Journal begins at Mon 2021-10-18 22:19:37 MDT, ends at Wed 2021-11-10 14:29:46 MST. --
Nov 10 14:28:30 framework systemd[1]: Started key remapping daemon.
Nov 10 14:28:30 framework keyd[26052]: Starting keyd v1.1.2 (c7ee83350dc0064e9f03a780995efce18266ea4d).
Nov 10 14:28:30 framework keyd[26052]: Managing AT Translated Set 2 keyboard

@rvaiya
Copy link
Owner

rvaiya commented Nov 11, 2021

Thanks. I'm guessing the framework laptop creates a single evdev device for the keyboard and mouse and generates absolute rather than relative input events which keyd currently doesn't handle. If you can confirm this I should be able to fix it.

I've just added some additional logging to help debug the problem. Can you pull the latest commit and post the output of sudo KEYD_DEBUG=1 keyd -m while moving your mouse around? Do this while keyd is not running.

@suderman
Copy link
Author

Thanks for looking into this. I cloned the repo and installed the latest keyd. I wish I had more clues for you, but moving the cursor around on my trackpad produced zero output:

➜  work git clone https://github.com/rvaiya/keyd
Cloning into 'keyd'...
remote: Enumerating objects: 349, done.
remote: Counting objects: 100% (349/349), done.
remote: Compressing objects: 100% (223/223), done.
remote: Total 349 (delta 219), reused 255 (delta 125), pack-reused 0
Receiving objects: 100% (349/349), 145.05 KiB | 1.29 MiB/s, done.
Resolving deltas: 100% (219/219), done.

➜  work cd keyd
➜  keyd git:(master) make && sudo make install
mkdir -p bin
cc -DVERSION=\"1.1.2\" -DGIT_COMMIT_HASH=\"eecbd182f20d5ab5a7b5816895116dad1aaed853\" -DCONFIG_DIR=\""/etc/keyd"\" -DLOG_FILE=\""/var/log/keyd.log"\" -DLOCK_FILE=\""/var/lock/keyd.lock"\" -I/usr/local/include -L/usr/local/lib -O3 src/*.c -o bin/keyd -ludev
mkdir -p /etc/keyd
mkdir -p /usr/lib/systemd/system
mkdir -p /usr/bin
mkdir -p /usr/share/man/man1
install -m644 keyd.service /usr/lib/systemd/system
install -m755 bin/keyd /usr/bin
install -m644 keyd.1.gz /usr/share/man/man1

➜  keyd git:(master) sudo KEYD_DEBUG=1 bin/keyd -m
src/main.c:977: Debug mode enabled.
src/main.c:194: Ignoring Video Bus (/dev/input/event3)
src/main.c:194: Ignoring Lid Switch (/dev/input/event0)
src/main.c:194: Ignoring Power Button (/dev/input/event1)
src/main.c:194: Ignoring Laptop Camera: Laptop Camera (/dev/input/event22)
src/main.c:194: Ignoring FRMW0001:00 32AC:0006 Wireless Radio Control (/dev/input/event4)
src/main.c:194: Ignoring FRMW0001:00 32AC:0006 Consumer Control (/dev/input/event5)
src/main.c:194: Ignoring PIXA3854:00 093A:0274 Mouse (/dev/input/event6)
src/main.c:194: Ignoring (null) (/dev/input/mouse0)
src/main.c:194: Ignoring PIXA3854:00 093A:0274 Touchpad (/dev/input/event7)
src/main.c:194: Ignoring (null) (/dev/input/mouse1)
src/main.c:194: Ignoring HDA Intel PCH Front Headphone (/dev/input/event9)
src/main.c:194: Ignoring HDA Intel PCH HDMI/DP,pcm=3 (/dev/input/event10)
src/main.c:194: Ignoring HDA Intel PCH HDMI/DP,pcm=7 (/dev/input/event11)
src/main.c:194: Ignoring HDA Intel PCH HDMI/DP,pcm=8 (/dev/input/event12)
src/main.c:194: Ignoring HDA Intel PCH HDMI/DP,pcm=9 (/dev/input/event13)
src/main.c:194: Ignoring HDA Intel PCH HDMI/DP,pcm=10 (/dev/input/event14)
src/main.c:194: Ignoring HDA Intel PCH HDMI/DP,pcm=11 (/dev/input/event15)
src/main.c:194: Ignoring HDA Intel PCH HDMI/DP,pcm=12 (/dev/input/event16)
src/main.c:194: Ignoring HDA Intel PCH HDMI/DP,pcm=13 (/dev/input/event17)
src/main.c:194: Ignoring HDA Intel PCH HDMI/DP,pcm=14 (/dev/input/event18)
src/main.c:194: Ignoring HDA Intel PCH HDMI/DP,pcm=15 (/dev/input/event19)
src/main.c:194: Ignoring HDA Intel PCH HDMI/DP,pcm=16 (/dev/input/event20)
src/main.c:194: Ignoring HDA Intel PCH HDMI/DP,pcm=17 (/dev/input/event21)
src/main.c:188: Detected keyboard node /sys/devices/platform/i8042/serio0/input/input2/event2 (AT Translated Set 2 keyboard) ismouse: 0
src/main.c:194: Ignoring ImExPS/2 Generic Explorer Mouse (/dev/input/event23)
src/main.c:194: Ignoring (null) (/dev/input/mouse2)
src/main.c:194: Ignoring PC Speaker (/dev/input/event8)
src/main.c:194: Ignoring (null) (/dev/input/mice)

...even though I was moving my touchpad's cursor around, there was no more output until I Control-C'ed this. The only other thing I noticed, was that while running keyd normally (without the -m switch), although my cursor is locked up, my gestures defined in libinput-gestures.conf still function properly. So it doesn't disable my touchpad completely...

@rvaiya
Copy link
Owner

rvaiya commented Nov 12, 2021 via email

@suderman
Copy link
Author

Yes, I believe you have it correct. keyd -m produces no output while moving the trackpad (but at least I can still move the trackpad). Also, typing any key on keyboard does display the expected down/up events. It's only my trackpad that's ignored while monitoring, and locked up while intercepting.

@rvaiya
Copy link
Owner

rvaiya commented Nov 12, 2021

Can you paste the output of curl -L "https://git.io/JXN4w"|sudo python3 after pressing a key and moving the trackpad around?

@suderman
Copy link
Author

OK, I pressed the letter "a" on my keyboard, and then I moved the trackpad a little:

➜  ~ curl -L "https://git.io/JXN4w"|sudo python3
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   697  100   697    0     0   1977      0 --:--:-- --:--:-- --:--:--  1977
/dev/input/event2 (AT Translated Set 2 keyboard) 4 4 30
a/dev/input/event2 (AT Translated Set 2 keyboard) 1 30 1
/dev/input/event2 (AT Translated Set 2 keyboard) 0 0 0
/dev/input/event2 (AT Translated Set 2 keyboard) 4 4 30
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 57 1989
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 53 821
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 54 348
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 1 330 1
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 1 325 1
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 0 821
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 1 348
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 4 5 0
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 0 0 0
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 4 5 17600
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 0 0 0
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 53 820
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 0 820
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 4 5 23300
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 0 0 0
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 53 819
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 0 819
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 4 5 30300
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 0 0 0
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 53 816
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 0 816
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 4 5 37200
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 0 0 0
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 53 812
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 0 812
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 4 5 44200
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 0 0 0
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 53 808
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 0 808
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 4 5 51100
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 0 0 0
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 53 804
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 0 804
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 4 5 58000
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 0 0 0
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 53 800
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 0 800
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 4 5 65100
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 0 0 0
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 53 796
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 54 349
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 0 796
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 1 349
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 4 5 71900
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 0 0 0
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 53 790
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 0 790
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 4 5 78800
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 0 0 0
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 53 785
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 0 785
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 4 5 85900
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 0 0 0
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 53 781
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 54 348
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 0 781
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 1 348
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 4 5 92800
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 0 0 0
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 53 777
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 0 777
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 4 5 99700
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 0 0 0
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 53 774
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 54 347
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 0 774
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 1 347
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 4 5 106800
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 0 0 0
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 53 773
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 54 346
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 0 773
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 1 346
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 4 5 113600
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 0 0 0
/dev/input/event7 (PIXA3854:00 093A:0274 Touchpad) 3 57 -1

@rvaiya
Copy link
Owner

rvaiya commented Nov 12, 2021 via email

@suderman
Copy link
Author

Ahhh yes, it must have something to do with Wayland. I just tried it in X Gnome and everything seems to work fine there. No problems moving my cursor!

Back in Sway, I tried your python script while keyd is running. Again, the cursor is stuck in place, but the terminal output is plentiful (same as I shared last time). It's interesting because although there is no visual feedback from the cursor, I'm finally seeing visual feedback in the form of logs while I move the trackpad.

@rvaiya
Copy link
Owner

rvaiya commented Nov 13, 2021

I can't seem to reproduce this using your setup (arch + sway). To clarify, the output you are getting from the script is still coming from 'PIXA3854:00 093A:0274 Touchpad' and not the keyd virtual device right?

It seems something in your input stack doesn't like it when the keyboard is grabbed. Can you see if initialization order makes any difference (i.e ensuring that keyd is started before sway)? Do you have any other machines working with the same setup?

@rvaiya
Copy link
Owner

rvaiya commented Nov 13, 2021

sway logs might also help (restart keyd after sway to see if it produces any interesting output). e.g

sway -V > /tmp/sway.log 2>&1

and then

systemctl restart keyd
cat /tmp/sway.log

@suderman
Copy link
Author

suderman commented Nov 13, 2021

OK, I've narrowed it down and it's my Sway config. Specifically, the existence of this line in my sway config locks up the cursor:

input type:touchpad {
  events disabled_on_external_mouse
}

...obviously, I don't mind taking this line out. :-) Sorry for the hassle and thanks for helping me find the problem.

(oh, and no I did not have an external mouse plugged in during any of this...)

@rvaiya
Copy link
Owner

rvaiya commented Nov 14, 2021 via email

@rvaiya
Copy link
Owner

rvaiya commented Feb 11, 2022

For posterity:

I believe this workaround should no longer be required in the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants