InsideJob
Posts: 58
Joined: Sat Jul 04, 2015 3:00 pm

right click with stylus pen

Mon Jul 06, 2015 7:48 pm

Under Ubuntu 12.04 I just held down the stylus pen and after a certain timeout interval (like two seconds) it right clicked. For the life of me I can't figure out how to do it under Raspbian. Is there a magic gesture or secret key I have to press?

InsideJob
Posts: 58
Joined: Sat Jul 04, 2015 3:00 pm

Re: right click with stylus pen

Wed Jul 15, 2015 1:47 pm

There's a guy on the LXDE forums that's been waiting a year for a solution to this same problem, so I guess I'm on my own (again.)

Code: Select all

[email protected] ~ $ xinput
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ ADS7846 Touchscreen                     	id=6	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
[email protected] ~ $ xinput --list 6
ADS7846 Touchscreen                     	id=6	[slave  pointer  (2)]
	Reporting 4 classes:
		Class originated from: 6. Type: XIButtonClass
		Buttons supported: 5
		Button labels: "Button Unknown" "Button Unknown" "Button Unknown" "Button Wheel Up" "Button Wheel Down"
		Button state: 1
		Class originated from: 6. Type: XIValuatorClass
		Detail for Valuator 0:
		  Label: Abs X
		  Range: 0.000000 - 4095.000000
		  Resolution: 0 units/m
		  Mode: absolute
		  Current value: 3958.000000
		Class originated from: 6. Type: XIValuatorClass
		Detail for Valuator 1:
		  Label: Abs Y
		  Range: 0.000000 - 4095.000000
		  Resolution: 0 units/m
		  Mode: absolute
		  Current value: 2657.000000
		Class originated from: 6. Type: XIValuatorClass
		Detail for Valuator 2:
		  Label: Abs Pressure
		  Range: 0.000000 - 65535.000000
		  Resolution: 0 units/m
		  Mode: absolute
		  Current value: 64707.000000
[email protected] ~ $ xinput list-props 6
Device 'ADS7846 Touchscreen':
	Device Enabled (114):	1
	Coordinate Transformation Matrix (115):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	Device Accel Profile (235):	0
	Device Accel Constant Deceleration (236):	1.000000
	Device Accel Adaptive Deceleration (237):	1.000000
	Device Accel Velocity Scaling (238):	10.000000
	Device Product ID (239):	0, 0
	Device Node (240):	"/dev/input/event0"
	Evdev Axis Inversion (241):	0, 0
	Evdev Axis Calibration (242):	3908, 226, 3982, 233
	Evdev Axes Swap (243):	0
	Axis Labels (244):	"Abs X" (232), "Abs Y" (233), "Abs Pressure" (234)
	Button Labels (245):	"Button Unknown" (231), "Button Unknown" (231), "Button Unknown" (231), "Button Wheel Up" (120), "Button Wheel Down" (121)
	Evdev Middle Button Emulation (246):	0
	Evdev Middle Button Timeout (247):	50
	Evdev Third Button Emulation (248):	0
	Evdev Third Button Emulation Timeout (249):	1000
	Evdev Third Button Emulation Button (250):	3
	Evdev Third Button Emulation Threshold (251):	20
	Evdev Wheel Emulation (252):	0
	Evdev Wheel Emulation Axes (253):	0, 0, 4, 5
	Evdev Wheel Emulation Inertia (254):	10
	Evdev Wheel Emulation Timeout (255):	200
	Evdev Wheel Emulation Button (256):	4
	Evdev Drag Lock Buttons (257):	0
I've got a pen with eraser and button but doesn't look like those are supported with this touchpad. There is a pressure event and a third button timeout interval however. So I'm hopefull there's a way to use xset to accomplish tap-and-hold right clicking.

If anyone already knows how, TIA for saving me some time. If not, I'll post the solution when I figure it out.

InsideJob
Posts: 58
Joined: Sat Jul 04, 2015 3:00 pm

Re: right click with stylus pen

Fri Jul 17, 2015 1:30 am

I dropped my Palm Pi on the floor and the screen broke... I can't do this from a remote desktop so it'll have to wait. Seems to me enabling tap-and-hold should be the default for evdev though, since it works with any stylus.

InsideJob
Posts: 58
Joined: Sat Jul 04, 2015 3:00 pm

Re: right click with stylus pen

Sun Jul 19, 2015 6:02 pm

Replacement is on the way. Looks like Wave Share discontinued the 3.5", maybe because of the brittle screens. I saw some other complaints about that on ebay feedback. They have a new kit that comes with a 5 inch HDMI screen though. I guess nobody likes using GPIO for the display.

http://www.wvshare.com/column/Raspberry_Pi.htm

InsideJob
Posts: 58
Joined: Sat Jul 04, 2015 3:00 pm

Re: right click with stylus pen

Tue Jul 28, 2015 12:24 am

palmpi.jpg
palmpi.jpg (52.94 KiB) Viewed 1752 times
Case finally got here from China. It's the only one that fits the 3.5" screen right so was worth the wait. Anywho, someone should have told me to RTFM :lol:

man evdev says:
Option "EmulateThirdButton" "boolean"
Enable third button emulation. Third button emulation emits a right button event (by default) by press‐
ing and holding the first button. The first button must be held down for the configured timeout and
must not move more than the configured threshold for the emulation to activate. Otherwise, the first
button event is posted as normal. Default: off. Property: "Evdev Third Button Emulation".

I put 1 (boolean true) in the /usr/share/X11/xorg.conf.d/99-calibration.conf file that xinput_calibrator had me make.

InsideJob
Posts: 58
Joined: Sat Jul 04, 2015 3:00 pm

Re: right click with stylus pen

Wed Aug 05, 2015 9:15 pm

It kills me that xinput_calibrator still isn't in the Raspbian repo. I ripped this ARM DEB package off the Adafruit people sometime ago but it's still good:
https://drive.google.com/file/d/0B4b1zD ... sp=sharing
The program itself hasn't been updated in a long time.

The first time you run it do it from a text console/terminal like this:
DISPLAY=:0.0 xinput_calibrator
That gets it to display the full output including 99-calibration.conf file contents, which you'll need to create yourself as root (sudo your fav text editor.)

The location it tells you is wrong though. The right place is:
/usr/share/X11/xorg.conf.d/99-calibration.conf
And lastly add two more options before the end of the file:
Option "EmulateThirdButton" "1"
Option "EmulateThirdButtonMoveThreshold" "60"
The default tap-and-hold timeout interval works fine for me.

Return to “Raspbian”