Coder Social home page Coder Social logo

Comments (6)

zsugabubus avatar zsugabubus commented on June 26, 2024
  1. Are you sure that your keyboard is really getting intercepted (by interception-tools)?
    • Map rules are very simple so if they are really there, I cannot think of any circumstance that they would not work.
  2. Try using xinput to get device ids then evtest /dev/input/event{id}, press CapsLock and watch for differences. If you get identical output, that should indicate (1).

from interception-k2k.

tim-hilt avatar tim-hilt commented on June 26, 2024

TL;DR: systemctl status udevmon doesn't show event27 to be active, which is the event associated with the new keyboard (if I understood correctly). How can I add this device to also be grabbed by interception-tools?


Ok, I made two traces:

  1. Here's the one for the Anne Pro 2
  2. Here's the one for my integrated Laptop-keyboard.

I stopped the interception-process beforehand to see differences more clearly. However, when I keep it running and try to evtest my integrated keyboard, I see an evtest output like this:

Testing ... (interrupt to exit)
***********************************************
  This device is grabbed by another process.
  No events are available to evtest while the
  other grab is active.
  In most cases, this is caused by an X driver,
  try VT-switching and re-run evtest again.
  Run the following command to see processes with
  an open fd on this device
 "fuser -v /dev/input/event3"
***********************************************

To me, this indicates, that the interception-tool does his job for the integrated keyboard, but not for the Anne Pro 2. Here's my udevmon.yaml:

~ λ cat /etc/interception/udevmon.yaml
---
- JOB: "intercept -g $DEVNODE | interception-k2k | uinput -d $DEVNODE"
  DEVICE:
    EVENTS:
      EV_KEY: [KEY_CAPSLOCK, KEY_ESC]

And here's the output of systemctl status udevmon:

~ λ systemctl status udevmon
● udevmon.service - Monitor input devices for launching tasks
     Loaded: loaded (/usr/lib/systemd/system/udevmon.service; enabled; vendor preset: disabled)
     Active: active (running) since Sat 2021-02-20 11:47:22 CET; 3min 6s ago
       Docs: man:udev(7)
   Main PID: 12443 (udevmon)
      Tasks: 17 (limit: 18886)
     Memory: 5.7M
     CGroup: /system.slice/udevmon.service
             ├─12443 /usr/bin/udevmon -c /etc/interception/udevmon.yaml
             ├─12453 sh -c intercept -g $DEVNODE | interception-k2k | uinput -d $DEVNODE
             ├─12454 sh -c intercept -g $DEVNODE | interception-k2k | uinput -d $DEVNODE
             ├─12455 intercept -g /dev/input/event24
             ├─12456 interception-k2k
             ├─12457 uinput -d /dev/input/event24
             ├─12458 intercept -g /dev/input/event22
             ├─12459 interception-k2k
             ├─12460 uinput -d /dev/input/event22
             ├─12494 sh -c intercept -g $DEVNODE | interception-k2k | uinput -d $DEVNODE
             ├─12495 intercept -g /dev/input/event3
             ├─12496 interception-k2k
             ├─12497 uinput -d /dev/input/event3
             ├─12504 sh -c intercept -g $DEVNODE | interception-k2k | uinput -d $DEVNODE
             ├─12505 intercept -g /dev/input/event19
             ├─12506 interception-k2k
             └─12507 uinput -d /dev/input/event19

Feb 20 11:47:22 arch systemd[1]: Started Monitor input devices for launching tasks.

I don't see event27 there, which represents the Anne Pro 2. How can I add that device?

from interception-k2k.

zsugabubus avatar zsugabubus commented on June 26, 2024

How can I add this device to also be grabbed by interception-tools?

Whew! According to https://gitlab.com/interception/linux/tools#how-it-works you can explicitly specify devices you would like to intercept, like:

# /etc/interception/udevmon.toml
# ...
  DEVICE:
    LINK: /dev/input/by-id/...

from interception-k2k.

tim-hilt avatar tim-hilt commented on June 26, 2024

Ok, first of all: Thanks for your help!

I have now modified my /etc/interception/udevmon.yaml to look like this:

---
- JOB: "intercept -g $DEVNODE | interception-k2k | uinput -d $DEVNODE"
  DEVICE:
    LINK: /dev/input/by-id/usb-OBINS_OBINS_AnnePro2_SN0000000001-event-kbd
    EVENTS:
      EV_KEY: [KEY_CAPSLOCK, KEY_ESC]

The identifier is correct. When I pass the event it links to to evtest I can see it react to keypresses. However the device still isn't grabbed. With udevmon activated, I don't see the warning banner in evtest. Also the output of systemctl status udevmon now looks like this, indicating (to me), that no event has been grabbed correctly, even though the correct config-file is used by the service:

~ λ systemctl status udevmon
● udevmon.service - Monitor input devices for launching tasks
     Loaded: loaded (/usr/lib/systemd/system/udevmon.service; enabled; vendor preset: disabled)
     Active: active (running) since Sat 2021-02-20 17:06:21 CET; 5min ago
       Docs: man:udev(7)
   Main PID: 988 (udevmon)
      Tasks: 1 (limit: 18886)
     Memory: 3.4M
     CGroup: /system.slice/udevmon.service
             └─988 /usr/bin/udevmon -c /etc/interception/udevmon.yaml

Feb 20 17:06:21 arch systemd[1]: Started Monitor input devices for launching tasks.

Do you see, where I went wrong?

from interception-k2k.

zsugabubus avatar zsugabubus commented on June 26, 2024

To be honest I'm (absolutely) not an expert in interception-tools, but I would try deleting EVENTS: (and lines below it) because if you pass LINK: I see no reason why devices should be filtered by EVENTS. Maybe this is why your keyboard not selected, because udevmon unable to detect these keys... it would also explain why we do not see any errors.

In addition, to make sure systemd does not swallow any error messages, you could try running udevmon from terminal.

Another stuff: What about LINK: *-event-kbd?

from interception-k2k.

tim-hilt avatar tim-hilt commented on June 26, 2024

Again: Thanks for the answer. Unfortunately that also didn't work. I think I might address this issue on the interception-tools-GitLab and come back to this issue, when I have news.

I'll close this issue for now. Thanks for all your help and insight!

from interception-k2k.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.