m1gin 31

[Tested on Ubuntu 20.04]

I have just realized that it is possible to use the touchpad's corners as customizable buttons! WOW!

Let's list the parameters of the touchpad:

synclient -l

I will assign the corners of the touchpad to different buttons:

synclient LTCornerButton=9 LBCornerButton=10 RTCornerButton=11 RBCornerButton=12

Now, the top left corner acts as if mouse button9, top right corner: button 11, etc.

To observe this in action let's get the touchpad device id first:

xinput list

Now let's query the status of the device. (Note that 12 is my touchpad device id, learned from the above command)

xinput query-state 12

To be able to see it in real time, run the command every 1 second:

watch -n 1 xinput query-state 12

Now when I tap and hold touchpad top right corner I see result as follow (pay attention to button[11]=down)

We can also create a bash script which is checking the pressed button. After that we can do things as when those buttons clicked:

xinput test 12 | grep "button press"

It's also possible to use xbindkeys and assign commands when buttons pressed:

Add some lines like below to the ~/.xbindkeysrc file:

"xte 'keydown Control_L' 'key a' 'keyup Control_L'"
b:11 + Release

Add to: