1

I have a touchscreen device for which I have enabled third button emulation in xinput:

Device 'ft5x_ts':
...
Evdev Third Button Emulation (257): 1
Evdev Third Button Emulation Timeout (258): 750
Evdev Third Button Emulation Button (259):  3
Evdev Third Button Emulation Threshold (260):   20
...

(full log)

However, the emulation doesn't work - the right button click events never appear. Here's the sample of xev output:

ButtonPress event, serial 45, synthetic NO, window 0x2000001,
root 0x44, subw 0x0, time 2058845, (94,90), root:(96,117),
state 0x100, button 1, same_screen YES

MotionNotify event, serial 45, synthetic NO, window 0x2000001,
root 0x44, subw 0x0, time 2059658, (94,89), root:(96,116),
state 0x100, is_hint 0, same_screen YES

MotionNotify event, serial 45, synthetic NO, window 0x2000001,
root 0x44, subw 0x0, time 2060101, (94,89), root:(96,116),
state 0x100, is_hint 0, same_screen YES

ButtonRelease event, serial 45, synthetic NO, window 0x2000001,
root 0x44, subw 0x0, time 2060101, (94,89), root:(96,116),
state 0x100, button 1, same_screen YES

As you can see, the interval between ButtonPress and ButtonRelease is greater than 750 ms, and the pointer movement is below the 20 pix threshold, yet xev reports button 1 to be pressed, not button 3.

Ironically, when I configure my USB mouse in the same way, long clicks on button 1 do emulate button 3:

ButtonPress event, serial 45, synthetic NO, window 0x2000001,
root 0x44, subw 0x0, time 2870367, (48,82), root:(50,109),
state 0x0, button 3, same_screen YES

MotionNotify event, serial 45, synthetic NO, window 0x2000001,
root 0x44, subw 0x0, time 2870422, (49,81), root:(51,108),
state 0x400, is_hint 0, same_screen YES

ButtonRelease event, serial 45, synthetic NO, window 0x2000001,
root 0x44, subw 0x0, time 2870590, (49,81), root:(51,108),
state 0x400, button 3, same_screen YES

Can anyone help me out, perhaps point to some anomalies I didn't notice?

PS. Third button emulation used to work with my touchscreen under Debian Wheezy, and stopped working when I upgraded to Jessie. For now, I reverted my last backup to get Wheezy installation back, but I still need a solution as Wheezy is phasing out.

migrated from unix.stackexchange.com Oct 28 '15 at 10:47

This question came from our site for users of Linux, FreeBSD and other Un*x-like operating systems.

  • Is there any difference if you crank up Evdev Third Button Emulation Threshold (260): to say, 50? – Leathe Oct 30 '15 at 19:58
  • @Leathe Nope. Besides, 20 pixels is already quite a lot of threshold, sometimes small scroll/drag actions are difficult to perform because of it. – Dmitry Grigoryev Oct 31 '15 at 20:35
0

According to this and this, right click emulation is a common issue in Debian Jessie, not limited to a particular distribution. A workaround which worked for me (on a 10-point touchscreen) is to use twofing utility:

git clone https://github.com/Plippo/twofing
sudo apt-get install build-essential libx11-dev libxtst-dev libxi-dev x11proto-randr-dev libxrandr-dev
cd twofing; make
./twofing /dev/input/eventXX

eventXX is the device corresponding to the touchscreen, which can be found with xinput list. The right click event is performed by two-finger click, and as a bonus you'll get the scrolling gesture (two-finger drag) and zoom-in/zoom-out gesture (two-finger pinch). I didn't try twofing with a resistive touchscreen, but I suppose it will not work since resistive touchscreens don't support multitouch.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.