0

I've created a virtual keyboard using uinput

I can see the input device in /sys/devices/virtual/input

as input7

The key presses don't seem to be registered.

From what I can tell it's not showing up in xinput -list

Update

Looking at input7 directory in /sys/devices/virtual/input I could see a directory event4

Using evtest as suggested by @dirkt I can see the my keyboard events are being generated successfully.

Event: time 1624187132.489135, type 1 (EV_KEY), code 45 (KEY_X), value 1
Event: time 1624187132.489135, -------------- SYN_REPORT ------------
Event: time 1624187134.489502, type 1 (EV_KEY), code 45 (KEY_X), value 0
Event: time 1624187134.489502, -------------- SYN_REPORT ------------
Event: time 1624187134.681998, type 1 (EV_KEY), code 45 (KEY_X), value 1
Event: time 1624187134.681998, -------------- SYN_REPORT ------------
Event: time 1624187136.682230, type 1 (EV_KEY), code 45 (KEY_X), value 0
Event: time 1624187136.682230, -------------- SYN_REPORT ------------
Event: time 1624187136.682537, type 1 (EV_KEY), code 45 (KEY_X), value 1
Event: time 1624187136.682537, -------------- SYN_REPORT ------------
Event: time 1624187138.683337, type 1 (EV_KEY), code 45 (KEY_X), value 0
Event: time 1624187138.683337, -------------- SYN_REPORT ------------
Event: time 1624187138.683697, type 1 (EV_KEY), code 45 (KEY_X), value 1
Event: time 1624187138.683697, -------------- SYN_REPORT ------------
Event: time 1624187140.684101, type 1 (EV_KEY), code 45 (KEY_X), value 0
Event: time 1624187140.684101, -------------- SYN_REPORT ------------
Event: time 1624187144.894104, type 1 (EV_KEY), code 45 (KEY_X), value 1
Event: time 1624187144.894104, -------------- SYN_REPORT ------------
Event: time 1624187146.895425, type 1 (EV_KEY), code 45 (KEY_X), value 0
Event: time 1624187146.895425, -------------- SYN_REPORT ------------

Now I think I need to add it to my xorg config so that xfce can pick up the events.

  • Look for your device under `/dev/input/event*`, use `evtest` to check if it receives events; make sure X etc. picks it up if you want to use it for applications. – dirkt Jun 20 '21 at 05:19
  • @dirkt Thank you. Using `evtest` I can see the events coming in. Do I just need to add it to my Xorg config? I'm using xfce. Why isn't it picked up automatically? Is it because I'm creating the device after login? – patrick_corrigan Jun 20 '21 at 11:11
  • Usually new input-layer devices are picked up automatically through `udev` and the `evdev` driver with the default `InputClass` specs. I do not know why this doesn't work for your `uinput` device, so that needs debugging (and debugging `udev` is no fun...). Alternatively, try to create the device before the X server gets started, and see if that works. – dirkt Jun 20 '21 at 11:48

0 Answers0