Choose style:

Author Topic: evtest no longer working for mouse events (SOLVED)  (Read 3040 times)

0 Members and 1 Guest are viewing this topic.

Offline stefanreich

  • Jr. Member
  • **
  • Posts: 73
  • Karma: 4
  • New Forum User
    • View Profile
    • Eleutheria learns to think.
  • Peppermint version(s): 7
evtest no longer working for mouse events (SOLVED)
« on: February 20, 2015, 01:11:23 pm »
Hi!

A very important feature I need for my automation software is to be notified of global mouse clicks. This used to work with "evtest" in older Peppermint (3 or 4).

Now, in Peppermint 5, it stopped working (with same code). evtest always says:

Code: [Select]
  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.

Has something changed in the X-server between the versions?

Any other idea on how to globally grab mouse events? (Not intercept necessarily, just be-notified-of.)

Cheers,
Stefan
« Last Edit: February 23, 2015, 08:08:42 am by stefanreich »

Offline stefanreich

  • Jr. Member
  • **
  • Posts: 73
  • Karma: 4
  • New Forum User
    • View Profile
    • Eleutheria learns to think.
  • Peppermint version(s): 7
Re: evtest no longer working for mouse events
« Reply #1 on: February 20, 2015, 01:33:46 pm »
OK, xmacro can do what I want... almost. It displays mouse events correctly, but also screws up the mouse pointer to the point of only hard reboot helping... lol. I'll browse the xmacro sources.

Offline stefanreich

  • Jr. Member
  • **
  • Posts: 73
  • Karma: 4
  • New Forum User
    • View Profile
    • Eleutheria learns to think.
  • Peppermint version(s): 7
Re: evtest no longer working for mouse events
« Reply #2 on: February 20, 2015, 02:45:50 pm »
OK, for now I can use key-mon which displays keyboard and mouse events on the desktop.

Still, a proper mouse click monitoring solution would be appreciated if anyone knows one? Linux is hard in that respect, Windows is actually easier.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26276
  • Karma: 2855
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: evtest no longer working for mouse events
« Reply #3 on: February 20, 2015, 04:53:15 pm »
The cause:-

evtest is being blocked by
Option "GrabEventDevice" "true"
which seems to be implied as "true" by default in the new synaptics driver in Ubuntu >= 13.10 (xserver-xorg-input-synaptics)

See here:
http://www.x.org/archive/X11R7.6/doc/man/man4/synaptics.4.xhtml

The solution:-

Create a custom synaptics configuration file and set that option to false:
Code: [Select]
sudo gedit /usr/share/X11/xorg.conf.d/20-custom-synaptics.conf
and make it read:
Code: [Select]
Section "InputClass"
Identifier "custom touchpad configuration"
MatchIsTouchpad "on"
Option "GrabEventDevice" "false"
EndSection
SAVE the file.

Log off and on again (or reboot)

evtest should now work.



To undo:-

Code: [Select]
cd /usr/share/X11/xorg.conf.d
then
Code: [Select]
sudo rm -v 20-custom-synaptics.conf
then log off/on or reboot.
« Last Edit: February 20, 2015, 06:03:25 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline stefanreich

  • Jr. Member
  • **
  • Posts: 73
  • Karma: 4
  • New Forum User
    • View Profile
    • Eleutheria learns to think.
  • Peppermint version(s): 7
Re: evtest no longer working for mouse events
« Reply #4 on: February 23, 2015, 08:08:21 am »
Yes, works, thank you! :)

I'm still looking for a portable (pure Java) way to monitor mouse+keyboard (a hotkey to stop a running automation script would be VERY nice...), but this is also interesting.

Thanks,
Stefan