User Tools

Site Tools


doc:appunti:linux:sa:touchpad_disable

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
doc:appunti:linux:sa:touchpad_disable [2021/05/12 10:33] – [Using Fn+ESC on the Teclast F6] niccolodoc:appunti:linux:sa:touchpad_disable [2021/05/12 19:08] – [Mapping Fn+ESC on the Teclast F6] niccolo
Line 42: Line 42:
 Replace the **zero** with **1** to re-enable it. Replace the **zero** with **1** to re-enable it.
  
-===== Using Fn+ESC on the Teclast F6 =====+===== Mapping Fn+ESC on the Teclast F6 ===== 
 + 
 +The ESC key on the **Teclast F6 notebook** has the blue label indicating that the shortcut **Fn+ESC** should trigger the **touchpad toggle** function, but it does not work in GNU/Linux. 
 + 
 +Using the **evtest** tool we can see that the Fn+ESC keys produces three events, i.e. it is the same as pressing three keys together:
  
 <code> <code>
Line 54: Line 58:
 Event: time 1620808298.473572, type 4 (EV_MSC), code 4 (MSC_SCAN), value 76 Event: time 1620808298.473572, type 4 (EV_MSC), code 4 (MSC_SCAN), value 76
 Event: time 1620808298.473572, type 1 (EV_KEY), code 85 (KEY_ZENKAKUHANKAKU), value 1 Event: time 1620808298.473572, type 1 (EV_KEY), code 85 (KEY_ZENKAKUHANKAKU), value 1
 +</code>
 +
 +The keys are **Left Control**, **Left Meta** (also known as //Left Logo// or //Lef Windows// key) and the key used to toggle from Zenkaku (full-width) to Hankaku (half-width) Japanese character spacing :-O
 +
 +Using **udev** I remapped the ''ZENKAKUHANKAKU'' key to the more useable **ESC** (see this page about **[[remap_keyboard_keys#customize_events_using_udev|customize udev events]]**):
 +
 +<file>
 +evdev:atkbd:dmi:*
 + KEYBOARD_KEY_76=esc
 +</file>
 +
 +Finally, using the XFCE **Settings** => **Keyboard**, I associated the **Ctrl+Super+Escape** keyboard shortcut (where //Super// means //Left Win//) to the following shell script **/usr/local/bin/touchpad-toggle**:
 +
 +<code bash>
 +#!/bin/sh
 +STATE="$(xinput --list-props 11 | egrep '^\s+Device Enabled' | rev | awk '{print $1}')"
 +set_on() {
 +    xinput set-prop 11 154 1
 +    echo "Touchpad enabled"
 +}
 +set_off() {
 +    xinput set-prop 11 154 0
 +    echo "Touchpad disabled (pass \"1\" as first option to re-enable it)"
 +}
 +case "$1" in
 +    on|yes|1)
 +        set_on
 +        ;;
 +    off|no|0)
 +        set_off
 +        ;;
 +    *)
 +        if [ "$STATE" -eq "1" ]; then
 +            set_off
 +        else
 +            set_on
 +        fi
 +        ;;
 +esac
 </code> </code>
  
doc/appunti/linux/sa/touchpad_disable.txt · Last modified: 2021/05/13 09:42 by niccolo