You are not logged in.

#1 2016-03-13 08:53:35

cer_nagas
Member
Registered: 2015-07-01
Posts: 25

Cannot use hotkey with touchpad

Hi, the behavior I want is: after starting X, the touchpad is off by default. But then, when I want to use, I can turn it on (and off) using the touchpad key on manufacturer's keyboard.
The touchpad is normally on by default.
I tried to turn it off using:

synclient TouchpadOff=1

But then I cannot use the touchpad key to turn it on and off again. I have to use synclient to turn it on, and while it's on, it can be controlled by the touchpad key.
Is there any way I can track what the system does when I push that touchpad button? And do you have any other (better) solution for this?

Offline

#2 2016-03-13 09:00:08

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,448

Re: Cannot use hotkey with touchpad

xbindkeys -k

after this press your touchpad button, to track the keycode/sym.

Offline

#3 2016-03-13 09:32:03

cer_nagas
Member
Registered: 2015-07-01
Posts: 25

Re: Cannot use hotkey with touchpad

Thank you Docbroke, but what I want to do is to track which command that button is binded to. I tried binding directly the Touchpad button, but it's not good. Seems like it doesn't override the default behavior, but they two run simultaniously, so it's not stable.

Offline

#4 2016-03-13 09:46:14

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,448

Re: Cannot use hotkey with touchpad

well mostly your key will be identified as "XF86TouchpadToggle", you can bind that key with command "synclient TouchpadOff=0" in your .xbindkeysrc and put xbindkeys in start-up program list, you may have to write a script to use toggle with that single key, or use two different keys for on and off your touchpad

Offline

#5 2016-03-13 10:14:32

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,448

Re: Cannot use hotkey with touchpad

alright I did it like this,

~/bin/touchpad

#!/bin/bash

pad=$(synclient | grep TouchpadOff | awk -F= '{print $2}')

if [ ${pad} == 0 ]; then synclient TouchpadOff=1
fi

if [ ${pad} == 1 ]; then synclient TouchpadOff=0
fi

~/.xbindkeysrc

## toggle touchpad ##
"/home/sharad/bin/touchpad"
   XF86TouchpadToggle

+ add xbindkeys to your startup programs or .xinitrc

EDIT: Well in my case the key xf86touchpadtoggle was free (not bound to anything) as I am using barebone i3, but depending your window manager that key may be bound to some command, which you may need to find out

Last edited by Docbroke (2016-03-13 10:31:21)

Offline

Board footer

Powered by FluxBB