On Thu, Oct 13, 2016 at 01:31:06PM +0200, Tobia Conforto wrote: > Yes, I probably misused a couple of terms. > > As you say, the middle button emulation happens in the evdev Xorg > driver, in fact it's controlled by the "Emulate3Buttons" option. The > kernel simply generates the MSC_SCAN and BTN_* codes that I pasted. > > So, as far as I can tell, there are two ways to get what I need (which > is middle button emulation A+B outputting button number 2, while > having the physical button C outputting some other number instead of > 2.) > > Option 1. > Have the Xorg driver (evdev or another?) remap button C from 2 to 8, > while still providing an emulation for A+B to number 2. This is > clearly something that an Xorg driver could do, but I don't know > whether there is an existing driver that can be configured to do so, > or if I would need to patch / write one. (Hence this thread.) > > By the way, this could arguably be considered a bug in the > Emulate3Buttons feature: if I remap button 2 to 8, because it's > physically in a different position on the trackball, the middle button > emulation should still output number 2, which is what is needed to > paste stuff.
hmm, yeah, after looking at the code the ButtonMapping option merely sets the X logical button mapping on startup, the one that is changed by all the x client tools. There is no internal button mapping. I think what you could do is map MB emulation to button 10 (that is driver-internal) and then init the button mapping so that button 10 is logical button 2 and button 2 is logical button 8. > Option 2. > Change the kernel mapping between MSC_SCAN and BTN_* codes, so that > button C won't output BTN_MIDDLE in the first place. Again, this is > something the kernel can clearly do, but I don't know where that > mapping is stored, and whether it can be changed without patching the > kernel or writing an input driver. on most usb devices it's handled by the HID code, so I don't think you can arbitrarily remap without extra efforts. never tried though. Cheers, Peter _______________________________________________ xorg@lists.x.org: X.Org support Archives: http://lists.freedesktop.org/archives/xorg Info: https://lists.x.org/mailman/listinfo/xorg Your subscription address: %(user_address)s