Prevent accidental clicks of thinkpad x230 touchpad
Posted: 28 Mar 2024, 13:09
Touchpad has never worked 100% reliably on thinkpads, but the greatest nuisance has always been the proneness to accidental touching while typing. There were some driver versions which tried to address that but never reliably.
So I have some up with an idea - and gemini put it to action: the touchpad and its left click should only work when fn button is pressed. Makes you use the mouse as a minigun, so no drinking coffee while navigating the screen but it has become completely immune to accidental touches.
Still not perfect, but does the trick.
So I have some up with an idea - and gemini put it to action: the touchpad and its left click should only work when fn button is pressed. Makes you use the mouse as a minigun, so no drinking coffee while navigating the screen but it has become completely immune to accidental touches.
Still not perfect, but does the trick.
Code: Select all
#NoEnv
SendMode Input
; State variable to keep track of whether Fn key is pressed
FnKeyPressed := 0
; Check if the Fn key (SC163) is being pressed
SC163::
FnKeyPressed := 1
BlockInput, MouseMoveOff ; Enable mouse input
SetTimer, DisableMouseInput, -1 ; Set a timer to disable mouse input after 1 ms
return
; Check if the Fn key (SC163) is being released
SC163 Up::
FnKeyPressed := 0
BlockInput, MouseMove ; Disable mouse input immediately
return
; Check if the left mouse button is pressed down
LButton::
if FnKeyPressed = 1
Send, {LButton Down}
return
; Check if the left mouse button is released
LButton Up::
Send, {LButton Up}
return
DisableMouseInput:
If !FnKeyPressed
BlockInput, MouseMove ; Disable mouse input
return