Skip to content

Commit fd1e334

Browse files
mrhpearsonjwrdegoede
authored andcommitted
platform/x86: thinkpad_acpi: Support hotkey to disable trackpoint doubletap
The hotkey combination Fn + G can be used to disable the trackpoint doubletap feature on Windows. Add matching functionality for Linux. Signed-off-by: Mark Pearson <[email protected]> Signed-off-by: Vishnu Sankar <[email protected]> Link: https://lore.kernel.org/r/[email protected] [[email protected]: Adjust for switch to sparse-keymap keymaps] [[email protected]: Do not log unknown event msg for doubletap when disabled] Tested-by: Mark Pearson <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Mark Pearson <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 1a22cb1 commit fd1e334

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

drivers/platform/x86/thinkpad_acpi.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ enum tpacpi_hkey_event_t {
183183
* directly in the sparse-keymap.
184184
*/
185185
TP_HKEY_EV_AMT_TOGGLE = 0x131a, /* Toggle AMT on/off */
186+
TP_HKEY_EV_DOUBLETAP_TOGGLE = 0x131c, /* Toggle trackpoint doubletap on/off */
186187
TP_HKEY_EV_PROFILE_TOGGLE = 0x131f, /* Toggle platform profile */
187188

188189
/* Reasons for waking up from S3/S4 */
@@ -372,6 +373,7 @@ static struct {
372373
u32 hotkey_poll_active:1;
373374
u32 has_adaptive_kbd:1;
374375
u32 kbd_lang:1;
376+
u32 trackpoint_doubletap:1;
375377
struct quirk_entry *quirks;
376378
} tp_features;
377379

@@ -3527,6 +3529,9 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
35273529

35283530
hotkey_poll_setup_safe(true);
35293531

3532+
/* Enable doubletap by default */
3533+
tp_features.trackpoint_doubletap = 1;
3534+
35303535
return 0;
35313536
}
35323537

@@ -3826,7 +3831,9 @@ static bool hotkey_notify_8xxx(const u32 hkey, bool *send_acpi_ev)
38263831
{
38273832
switch (hkey) {
38283833
case TP_HKEY_EV_TRACK_DOUBLETAP:
3829-
tpacpi_input_send_key(hkey, send_acpi_ev);
3834+
if (tp_features.trackpoint_doubletap)
3835+
tpacpi_input_send_key(hkey, send_acpi_ev);
3836+
38303837
return true;
38313838
default:
38323839
return false;
@@ -11033,6 +11040,9 @@ static bool tpacpi_driver_event(const unsigned int hkey_event)
1103311040
else
1103411041
dytc_control_amt(!dytc_amt_active);
1103511042

11043+
return true;
11044+
case TP_HKEY_EV_DOUBLETAP_TOGGLE:
11045+
tp_features.trackpoint_doubletap = !tp_features.trackpoint_doubletap;
1103611046
return true;
1103711047
case TP_HKEY_EV_PROFILE_TOGGLE:
1103811048
platform_profile_cycle();

0 commit comments

Comments
 (0)