I'm using Kubuntu 16.04 (xenial) on a laptop with an ELAN Touchscreen together with a DELL 750-AAHC active stylus. One of the buttons on the stylus behaves as a mouse middle-button, and I want it to be a right button instead.
I can achieve this by doing
$ xinput set-button-map "ELAN Touchscreen Pen" 1 3 2
(i.e., mapping the function of button 3, which must correspond to the right button, to physical button 2).
This does what I want, but the change is not permanent.
I added the command in
~/.xsessionrc (according to the answer on this post), so it's run automatically when I reboot, but the button mapping "randomly" reverts to default on its own: it's working as expected for a while, and suddenly I discover that it doesn't, so I get
$ xinput get-button-map "ELAN Touchscreen Pen" 1 2 3 4 5
and I have to remap it manually.
I tried a few "suspect" things to see what might be responsible for reverting, but I couldn't figure it out. It's not caused by
- suspending the laptop or turning off the screen
- rotating the screen (this was suspect because xinput is used on rotation to transform the input matrix.)
- toggling touchscreen, touchpad or stylus input on/off (also with xinput).
I've discovered that this problem is not specific to the stylus: I disabled the finger-touch capability of the screen ("ELAN Touchscreen") earlier for some reason, and I just discovered that it came back on its own (and the stylus right-click had again reverted). So it seems like all xinput changes revert to default for this unknown reason.
- KDE Plasma 5.5.5
- Qt 5.5.1
- Kernel 4.13.0-32-generic #35~16.04.1-Ubuntu 64-bit
xinput version 1.6.2
XI version on server: 2.3
X.Org X Server 1.19.5
Release Date: 2017-10-12
X Protocol Version 11, Revision 0