Is it possible to make the mouse in Windows click on the down press without the release?

My son is disabled. He plays this PC game called Tibia, just a simple point and click game.

I noticed when he played he would have to click 2 or 3 times before his character would move. This was because his hand spasms and moves before the release of the down press. So what I'm looking for is a way to skip straight to the click without waiting for the mouse release.


Solution 1:

Here is an AutoIt script. First install AutoIt. Then create an file with the extension .au3 (so like test.au3) and put the following text in there:

#include <AutoItConstants.au3>

HotKeySet("{ESC}","Quit")

While 1
    Sleep(1)
    If _IsPressed('01') Then
        MouseClick($MOUSE_CLICK_LEFT)
    EndIf
WEnd

Func _IsPressed($HexKey)
   Local $AR
   $HexKey = '0x' & $HexKey
   $AR = DllCall("user32","int","GetAsyncKeyState","int",$HexKey)
   If NOT @Error And BitAND($AR[0],0x8000) = 0x8000 Then Return 1
   Return 0
EndFunc

Func Quit()
    Exit
EndFunc

You can doubleclick on the script to start it.

As soon as you press the mouse button down it immediately clicks. If you press Escape the script stops.

I have made it into a little program. You can download it here: https://drive.google.com/file/d/1ZcAO8apIbl0SY4vYZPUzW8htYjnIyIe3/view?usp=sharing

Solution 2:

The free and open source AutoHotKey (AHK) can do this very easily:

#IfWinActive, Tibia
LButton:: 
  Click
  return
LButton UP::
  ; do nothing, avoid spurious "up" events
  return

The #IfWinActive makes sure that the behaviour triggers only within that game. If the string "Tibia" is not in the actual window title of the game, you can use a spy application shipping with AutoHotKey to find a correct selector. This solution is purely event based, so has no performance overhead and does not lag behind if the PC is busy.

This can be arbitrarily extended. For example you can change it so that if you press another key, the behaviour is temporarily disabled, you could opt to act the 4th or 5th mouse button as a click-and-release left button, and so on. Have a gander through the AutoHotKey Usage and Syntax chapter to see what's possible.

AHK can provide plenty of "quality of life" features, only limited by your imagination. For example it can scan the screen for specific images/icons, and perform actions if it detects certain things, and so on. I'd highly recommend for someone who is limited in what they can do with mouse or keyboard to have a deep look into it.