Après des mois de recherche d'une solution, j'ai décidé d'écrire un simple programme Python pour désactiver le pavé tactile pendant la frappe. Ajoutez le programme aux applications de démarrage pour qu'il s'exécute à chaque fois que vous démarrez votre ordinateur. Vous devez lancer xinput list
pour déterminer l'identifiant de votre clavier, dans mon cas il s'agit de 17.
xinput list
Virtual core pointer id=2 [master pointer (3)]
Virtual core XTEST pointer id=4 [slave pointer (2)]
Microsoft Microsoft® Nano Transceiver v1.0 id=11 [slave pointer (2)]
Microsoft Microsoft® Nano Transceiver v1.0 id=12 [slave pointer (2)]
DLL082A:01 06CB:76AF Touchpad id=14 [slave pointer (2)]
SynPS/2 Synaptics TouchPad id=18 [slave pointer (2)]
Virtual core keyboard id=3 [master keyboard (2)]
Virtual core XTEST keyboard id=5 [slave keyboard (3)]
Power Button id=6 [slave keyboard (3)]
Video Bus id=7 [slave keyboard (3)]
Power Button id=8 [slave keyboard (3)]
Sleep Button id=9 [slave keyboard (3)]
Microsoft Microsoft® Nano Transceiver v1.0 id=10 [slave keyboard (3)]
Integrated_Webcam_HD id=13 [slave keyboard (3)]
Intel Virtual Button driver id=15 [slave keyboard (3)]
Intel HID events id=16 [slave keyboard (3)]
** AT Translated Set 2 keyboard id=17 [slave keyboard (3)]**
Dell WMI hotkeys id=19 [slave keyboard (3)]
Microsoft Microsoft® Nano Transceiver v1.0 id=20 [slave keyboard (3)]
Voici le programme
import time
import subprocess
import threading
def main():
subprocess.call('gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click true', shell=True)
p = subprocess.Popen('xinput test 17', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
clickTime = [0, 0]
def checkTime():
keys = [37, 50, 62, 64, 105, 108, 133]
while True:
out = p.stdout.readline()
if len(out) < 1:
break
key = int(out.split()[-1])
if key not in keys:
clickTime[0] = time.time()
t = threading.Thread(target=checkTime)
t.start()
lastTime = 0
touchpad = True
while True:
inactive = time.time() - clickTime[0]
# print ('inactive for', inactive)
if inactive > 1:
if not touchpad:
print ('Enable touchpad')
subprocess.call('gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click true', shell=True)
touchpad = True
else:
if touchpad:
print ('Disable touchpad')
subprocess.call('gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click false', shell=True)
touchpad = False
time.sleep(0.5)
retval = p.wait()
if __name__ == '__main__':
main()