Recent versions of Chromium (and, presumably, Google Chrome) appear to be capable of differentiating between input from a touch screen, and input from a mouse. The problem is, on Linux, you’ll often find the capability a counter-productive one, since chromium sometimes outright IGNORES all touch input, rendering chromium utterly inoperable with a touchscreen. Mouse and touchpad operates chromium okay? Touchscreen operates other applications okay but you can’t so much as click a link on Chromium? You’re probably experiencing what I’m talking about.
There’s a report here, but it doesn’t seem to be going anywhere at the moment. Apparently Ubuntu carries a patch that tries to fix this, and I’m not sure how well it works, but at least on OpenSUSE we appear to be on our own. Fortunately, it’s possible to workaround, based on a suggestion in the comments.
First, on the terminal, type
xinput list
You should get a listing that looks like
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Atmel Atmel maXTouch Digitizer id=10 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=13 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Video Bus id=7 [slave keyboard (3)]
↳ Power Button id=8 [slave keyboard (3)]
↳ Lenovo EasyCamera id=9 [slave keyboard (3)]
↳ Ideapad extra buttons id=11 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=12 [slave keyboard (3)]
You need to look for the name of your touch screen hardware. In the above case, that is “Atmel Atmel maXTouch Digitizer”. Note the id number for the hardware on the right, 10 in the above case.
What you need to do is pass this id as a parameter to Chromium/Chrome. Like so:
chromium --touch-devices=10
Replace 10 of course with the id of your device. Launched this way, touch input should actually work reasonably on Chromium. In particular – you can switch tabs with touch, touch links to visit them, and even touch-scroll.
Of course, it’s a little tedious to do this every time you want to start Chromium. Fortunately, it’s not hard to put it all in a script. Like so:
#!/bin/bash
SCREEN=`xinput list | awk '/maXTouch/ { gsub(".*id=",""); print $1 }'`
exec chromium --touch-devices=$SCREEN
Of course, you’ll need to change ‘maXTouch’ above to a suitable identifier for your particular device, but running the script should start Chromium in touch-usable state. If you want, you can even modify your application menu entry to call this script instead of the Chromium binary directly.
UPDATE
It seems the above doesn’t quite work anymore on recent versions of Chromium. On my own box I’ve found that I now need to use the id of the parent item – ie “Virtual Core Pointer”, id=2 in the listing above. The rest of the procedure is basically the same, and if you use the script above you’ll need to make a minor adjustment to look for Virtual Core Pointer instead.
If you find, like I did for my box, that the id for Virtual Core Pointer stays the same all the time, instead of making a script you could just add the command line flag to the Chromium default settings config file. On OpenSUSE 13.2 this is at /etc/default/chromium, though I hear it can also be at /etc/chromium/default on some platforms. Simply add the following to the file:
CHROMIUM_FLAGS="--touch-devices=2"
This is cleaner and would probably also live across version updates :)
1390
Rate this post
Thanks!
An error occurred!
Recent Comments
SMB Business Solution
"At SMB Business Solution, we offer Salesforce customization services to tailor your platform ..."
Marc Wayne Schechtel
"Das ist eine super hilfreiche Anleitung! Vielen Dank, dass du die Schritte so ..."
Hochzeitsplaner
"Great Article. Thanks "