You are not logged in.

#1 2016-01-07 04:46:48

hippieben
Member
Registered: 2013-10-27
Posts: 218

Thinkpad Toggle Touchpad via extra keys?

Is there anyway to set up one of the extra keyboard keys to toggle the touchpad on and off?  I am using the libinput driver not synaptics so the xinput ID for the touchpad is not static and seems to change on reboot, which makes it difficult to simply write a script. 

Any ideas?

Offline

#2 2016-01-09 08:34:37

esonn
Member
From: Austria
Registered: 2015-10-01
Posts: 62

Re: Thinkpad Toggle Touchpad via extra keys?

Is the problem how to disable the touchpad or how to do map it to an extra key?
Regardless of changing xinput IDs, does the following code work to disable it?

xinput set-prop <currentID> "Device Enabled" 0

If so, you could add a shortcut via your DM (if supported), and point it to a simple script which will determine the currently correct ID by using xinput and grepping the correct ID, something like:

xinput set-prop $(xinput --list | grep TouchPad | grep -o id=.. | cut -d'=' -f2) "Device Enabled" 0

The code only turns it off, just add code for toggling.

Last edited by esonn (2016-01-09 08:43:35)


Anyone who quotes me in their sig is an idiot. -- Rusty Russell

Offline

Board footer

Powered by FluxBB