tl;dr
I just bought a Logitech T630. It's a Bluetooth mouse that supports several keyboard events via gestures (PDF). These gestures are fine and dandy but I have little use for them. I'm having a terrible time getting rid of them.
I want to do the following, in order of decreasing priority:
- disable these gestures
- remap the gestures (I think that without hacking the firmware or reverse engineering the Windows/OS X device drivers, this is not possible)
I don't want to:
- use Windows
- disable all gestures
For more info, read on…
buttons and gestures
The thirteen possible mouse events are:
- left click
- middle click
- right click
- scroll up
- scroll down
- scroll left
- scroll right
- swipe edge left
- swipe edge right
- two finger swipe left
- two finger swipe right
- double tap
- two finger double tap
The first seven are in order of how the OS maps them.
Only the first three are mechanical— all the other ones use the touch surface:
GUI options
Set up in Kubuntu Trusty was a breeze, but it offers little support for configuring these other gestures.
These gestures are not related to:
- touchpad (
synaptics
is not running) - accessibility
- hot corners
- standard mouse gestures
All of the settings related to those have been checked and they're all off.
command line settings
lomoco
The lomoco
utility to help configure special features of Logitech USB mice is not applicable.
xinput
I thought xinput
might offer some help:
$ xinput --list | grep pointer
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Ultrathin Touch Mouse id=13 [slave pointer (2)]
$ xinput --list-props 13
Device 'Ultrathin Touch Mouse':
Device Enabled (144): 1
Coordinate Transformation Matrix (146): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
Device Accel Profile (266): 0
Device Accel Constant Deceleration (267): 1.000000
Device Accel Adaptive Deceleration (268): 1.000000
Device Accel Velocity Scaling (269): 10.000000
Device Product ID (261): 1133, 45069
Device Node (262): "/dev/input/event11"
Evdev Axis Inversion (270): 0, 0
Evdev Axes Swap (272): 0
Axis Labels (273): "Rel X" (154), "Rel Y" (155), "Rel Horiz Wheel" (746), "Rel Vert Wheel" (265)
Button Labels (274): "Button Left" (147), "Button Middle" (148), "Button Right" (149), "Button Wheel Up" (150), "Button Wheel Down" (151), "Button Horiz Wheel Left" (152), "Button Horiz Wheel Right" (153), "Button Side" (1032), "Button Extra" (1033), "Button Unknown" (264), "Button Unknown" (264), "Button Unknown" (264), "Button Unknown" (264)
Evdev Middle Button Emulation (275): 0
Evdev Middle Button Timeout (276): 50
Evdev Third Button Emulation (277): 0
Evdev Third Button Emulation Timeout (278): 1000
Evdev Third Button Emulation Button (279): 3
Evdev Third Button Emulation Threshold (280): 20
Evdev Wheel Emulation (281): 0
Evdev Wheel Emulation Axes (282): 0, 0, 4, 5
Evdev Wheel Emulation Inertia (283): 10
Evdev Wheel Emulation Timeout (284): 200
Evdev Wheel Emulation Button (285): 4
Evdev Drag Lock Buttons (286): 0
Note the 13 button labels:
$ xinput --get-button-map "Ultrathin Touch Mouse"
1 2 3 4 5 6 7 8 9 10 11 12 13
Turning them off didn't help:
$ xinput --set-button-map "Ultrathin Touch Mouse" 1 2 3 4 5 6 7 0 0 0 0 0 0
Even though, e.g., it can turn the middle mouse button into a left click:
$ xinput --set-button-map "Ultrathin Touch Mouse" 1 1 3 4 5 6 7 0 0 0 0 0 0
xmodmap
Similar to xinput
, same results:
$ xmodmap -e "pointer = 1 2 3 4 5 6 7 0 0 0 0 0 0"
inputkbd
Suggested by elmicha below, this is working at the kernel level, trying to make the gestures result in null keyboard events. Should work, but no luck here, either, with the following process:
$ sudo input-kbd 4 > keymap # note the 4 is from /dev/input/event4
# edit the keymap to map any combination of keys to either 0 or 240 (KEY_UNKNOWN)
# e.g. change this:
# 0x700e0 = 29 # KEY_LEFTCTRL
# to this:
# 0x700e0 = 0 # KEY_LEFTCTRL
# or this:
# 0x700e0 = 240 # KEY_LEFTCTRL
$ sudo input-kbd -f keymap 4
$ sudo input-kbd 4 # should return the updated keymap
After doing this, the keymap shows no change.
xkbcomp
This was suggested by X
input hacker Peter Hutterer, certainly a man who should know what he was doing. Still, no luck:
$ xkbcomp -xkb $DISPLAY t630.xkb
# edit the keyboard description and replace the definition of any key to NoSymbol or VoidSymbol
# e.g. change this:
# key <LCTL> { [ Control_L ] };
# to this:
# key <LCTL> { [ NoSymbol ] };
# or this:
# key <LCTL> { [ VoidSymbol ] };
$ sudo xkbcomp -i 8 t630.xkb $DISPLAY # here the 8 is the id in xinput, names don't work
$ xkbcomp -xkb -i 8 $DISPLAY - # should return the updated keyboard description
After doing this, the keyboard description shows no change.
Peter felt that this was likely due to the fact that X
is confused as to the nature of the device as a keyboard or a mouse, kind of like this bug that has the opposite problem. This may explain why all the other expected items don't work. However, he also said that using evdev
should not work for the same reason.
evdev
It seemed at first to work, but it doesn't either. This attempts to leverage the generic input driver for X
to set the button mapping by appending the following to /usr/share/X11/xorg.conf.d/10-evdev.conf
or /etc/X11/xorg.conf.d/10-evdev.conf
:
# custom for Logitech Ultrathin Touch mouse
Section "InputDevice"
Identifier "Logitech bluetooth Touch Mouse"
Driver "evdev"
Option "Name" "Ultrathin Touch Mouse"
Option "ButtonMapping" "1 2 3 4 5 6 7 0 0 0 0 0 0"
EndSection
Section "InputClass"
Identifier "Ultrathin Touch Mouse"
Option "ButtonMapping" "1 2 3 4 5 6 7 0 0 0 0 0 0"
EndSection
This seems to work without errors in /var/log/Xorg.0.log
(using grep EE
), and xinput
confirms the button mapping, but it doesn't result in the desire effect.
This is known to work for the T631, however.
keyboard events
The problem lies, I think, in the fact that these gestures generate keyboard events:
$ sudo evemu-record /dev/input/event4 | grep "E: "
# swipe edge right
E: 0.000000 0004 0004 458976 # EV_MSC / MSC_SCAN 458976
E: 0.000000 0001 001d 0001 # EV_KEY / KEY_LEFTCTRL 1
E: 0.000000 0004 0004 458979 # EV_MSC / MSC_SCAN 458979
E: 0.000000 0001 007d 0001 # EV_KEY / KEY_LEFTMETA 1
E: 0.000000 0004 0004 458795 # EV_MSC / MSC_SCAN 458795
E: 0.000000 0001 000f 0001 # EV_KEY / KEY_TAB 1
E: 0.000000 0000 0000 0000 # ------------ SYN_REPORT (0) ----------
E: 0.002980 0004 0004 458976 # EV_MSC / MSC_SCAN 458976
E: 0.002980 0001 001d 0000 # EV_KEY / KEY_LEFTCTRL 0
E: 0.002980 0004 0004 458979 # EV_MSC / MSC_SCAN 458979
E: 0.002980 0001 007d 0000 # EV_KEY / KEY_LEFTMETA 0
E: 0.002980 0004 0004 458795 # EV_MSC / MSC_SCAN 458795
E: 0.002980 0001 000f 0000 # EV_KEY / KEY_TAB 0
E: 0.002980 0000 0000 0000 # ------------ SYN_REPORT (0) ----------
# swipe edge left
E: 3.306977 0004 0004 458978 # EV_MSC / MSC_SCAN 458978
E: 3.306977 0001 0038 0001 # EV_KEY / KEY_LEFTALT 1
E: 3.306977 0004 0004 458979 # EV_MSC / MSC_SCAN 458979
E: 3.306977 0001 007d 0001 # EV_KEY / KEY_LEFTMETA 1
E: 3.306977 0004 0004 458866 # EV_MSC / MSC_SCAN 458866
E: 3.306977 0001 00c1 0001 # EV_KEY / KEY_F23 1
E: 3.306977 0000 0000 0000 # ------------ SYN_REPORT (0) ----------
E: 3.310979 0004 0004 458978 # EV_MSC / MSC_SCAN 458978
E: 3.310979 0001 0038 0000 # EV_KEY / KEY_LEFTALT 0
E: 3.310979 0004 0004 458979 # EV_MSC / MSC_SCAN 458979
E: 3.310979 0001 007d 0000 # EV_KEY / KEY_LEFTMETA 0
E: 3.310979 0004 0004 458866 # EV_MSC / MSC_SCAN 458866
E: 3.310979 0001 00c1 0000 # EV_KEY / KEY_F23 0
E: 3.310979 0000 0000 0000 # ------------ SYN_REPORT (0) ----------
# two finger double tap
E: 10.225976 0004 0004 458983 # EV_MSC / MSC_SCAN 458983
E: 10.225976 0001 007e 0001 # EV_KEY / KEY_RIGHTMETA 1
E: 10.225976 0000 0000 0000 # ------------ SYN_REPORT (0) ----------
E: 10.229986 0004 0004 458983 # EV_MSC / MSC_SCAN 458983
E: 10.229986 0001 007e 0000 # EV_KEY / KEY_RIGHTMETA 0
E: 10.229986 0000 0000 0000 # ------------ SYN_REPORT (0) ----------
# two finger swipe left
E: 27.934977 0004 0004 589828 # EV_MSC / MSC_SCAN 589828
E: 27.934977 0001 0113 0001 # EV_KEY / BTN_SIDE 1
E: 27.934977 0000 0000 0000 # ------------ SYN_REPORT (0) ----------
E: 27.937983 0004 0004 589828 # EV_MSC / MSC_SCAN 589828
E: 27.937983 0001 0113 0000 # EV_KEY / BTN_SIDE 0
E: 27.937983 0000 0000 0000 # ------------ SYN_REPORT (0) ----------
# two finger swipe right
E: 32.513990 0004 0004 589829 # EV_MSC / MSC_SCAN 589829
E: 32.513990 0001 0114 0001 # EV_KEY / BTN_EXTRA 1
E: 32.513990 0000 0000 0000 # ------------ SYN_REPORT (0) ----------
E: 32.516994 0004 0004 589829 # EV_MSC / MSC_SCAN 589829
E: 32.516994 0001 0114 0000 # EV_KEY / BTN_EXTRA 0
E: 32.516994 0000 0000 0000 # ------------ SYN_REPORT (0) ----------
As far as the keymap is concerned, these refer to:
$ sudo input-kbd 4 | grep -e KEY_LEFTCTL -e KEY_LEFTMETA -e KEY_TAB -e KEY_LEFTALT -e KEY_F23 -e KEY_RIGHTMETA -e BTN_SIDE -e BTN_EXTRA
0x700e2 = 56 # KEY_LEFTALT
0x700e3 = 125 # KEY_LEFTMETA
0x700e7 = 126 # KEY_RIGHTMETA
0x7002b = 15 # KEY_TAB
0x70072 = 193 # KEY_F23
0x700e2 = 56 # KEY_LEFTALT
0x700e3 = 125 # KEY_LEFTMETA
0x700e7 = 126 # KEY_RIGHTMETA
0x90004 = 275 # BTN_SIDE
0x90005 = 276 # BTN_EXTRA
Double tap doesn't seem to do anything.
other references
It may also help to point out a reference to similar issues in a bug with the aforementioned mouse not being in the gnome-bluetooth
pincode database. Needless to say, further commentary on the subject is officially offtopic on that bug report, but the references may help add some perspective on the nature of this issue.
Here's the output of evemu-describe /dev/input/event4
FWIW.
Bluetooth adapters
FWIW I've used two different USB Bluetooth adapters:
$ lsusb | grep Bluetooth
Bus 007 Device 010: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
$ lsusb | grep Bluetooth
Bus 007 Device 011: ID 0a5c:21e8 Broadcom Corp. BCM20702A0 Bluetooth 4.0