Commit Graph

8 Commits

Author SHA1 Message Date
Jamie Lentin 94eefa2713 HID: lenovo: Use native middle-button mode for compact keyboards
By default the middle button is in a compatibility mode, and generates
standard wheel events when dragging with the middle trackpoint button.
Unfortunately this is buggy:
* The middle button comes up before starting wheel events, causing a middle
  click on whatever the mouse cursor was sitting on
* The USB keyboard always generates the "native" horizontal wheel event,
  regardless of mode.

Instead, enable the "native" mode the Windows driver uses, and add support
for the custom events this generates. This fixes the USB keyboard wheel
events, and the middle-click up event comes after the wheel events.

Signed-off-by: Jamie Lentin <jm@lentin.co.uk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-12-17 09:00:16 +01:00
Jamie Lentin e3cb0acd23 HID: lenovo: Add sensitivity control to compact keyboards
The trackpoint sensitivity can also be controlled, expose this via
sysfs.

Signed-off-by: Jamie Lentin <jm@lentin.co.uk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-12-17 09:00:16 +01:00
Jamie Lentin c87d92b302 HID: lenovo: Don't set EV_REP to avoid repeating mice buttons
On the USB keyboard, the VENDOR hotkeys share the same device as the
mouse. Setting EV_REP also affects mouse buttons, so leave it off.

The bluetooth keyboard still has autorepeating mouse buttons, as it
only has one device and is set by the KEYBOARD pages.

Signed-off-by: Jamie Lentin <jm@lentin.co.uk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-11-11 11:46:33 +01:00
Jamie Lentin 5556eb14b4 HID: lenovo: Move USB KEY_FILE to 0x00f9 to prevent scancode clash
The bluetooth keyboard also generates 0x00fa when the middle button is
pressed. Move the made-up report out of the way so we don't trigger
KEY_FILE when middle button is pressed

Signed-off-by: Jamie Lentin <jm@lentin.co.uk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-11-11 11:46:32 +01:00
Jamie Lentin f3d4ff0e04 HID: lenovo: Add support for Compact (BT|USB) keyboard
Add support for both ThinkPad Compact Bluetooth Keyboard with
TrackPoint and ThinkPad Compact USB Keyboard with TrackPoint.

Signed-off-by: Jamie Lentin <jm@lentin.co.uk>
Reviewed-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-07-29 11:24:47 +02:00
Jamie Lentin e0a6aad601 HID: lenovo: Don't call function in condition, show error codes
Signed-off-by: Jamie Lentin <jm@lentin.co.uk>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-07-29 11:24:47 +02:00
Jamie Lentin 6a5b414b42 HID: lenovo: Prepare support for adding other devices
Ensure all tpkbd specifics are within a postfixed function, the
main functions for the driver should just switch to the appropriate
function depending on product ID. Given this, we can add extra devices
by including extra postfixed functions.

Signed-off-by: Jamie Lentin <jm@lentin.co.uk>
Reviewed-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-07-29 11:24:46 +02:00
Jamie Lentin 94723bfa7b HID: lenovo: Rename hid-lenovo-tpkbd to hid-lenovo
Rename module and all functions within so we can add support for other
keyboards in the same file. Rename the _tp postfix to _tpkbd, to
signify functions relevant to the TP USB keyboard.

Signed-off-by: Jamie Lentin <jm@lentin.co.uk>
Reviewed-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-07-29 11:24:46 +02:00