Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Disabled gamer requesting help


  • Please log in to reply
1 reply to this topic
Vantezzle
  • New members
  • 1 posts
  • Last active: Nov 16 2015 04:49 PM
  • Joined: 07 Oct 2015

Hello, I'm a gamer who is stuck in bed and suffering from a disease that is making my muscles extremely weak. I thought that maybe with autohotkey I will have chance of playing games that I normally wouldn't be able to play due to my disease but I have absolutely no idea how to write scripts or what is possible to do with it. For now I had an idea and I am asking if it's possible to write a script that will do something like that: Send a few different buttons if I press middle mouse, send another buttons if I double click it and another if I hold it for x amount of time.  Would something like that be possible? Or maybe you have other suggestions?

 

Thanks for your taking time reading this.



Shadowpheonix
  • Members
  • 268 posts
  • Last active:
  • Joined: 10 Feb 2014

This is definitely possible.  Here is a basic example of one way to do it...

#MaxThreadsPerHotkey 1    ; This is needed to prevent multiple simultaneous instances of these hotkeys.
 
#IfWinActive YourGameWindowTitleHere    ; This makes the following hotkeys work only while your game is the active window.  Avoids problems in other programs.
 
; The following will send any desired keys when the middle mouse button is pressed.
MButton::
Send YourKeysHere
Return
 
; Detect a double click or a click & hold of the right mouse button (disables normal right click functionality) and sends your desired keys.
RButton::
If (A_PriorHotkey <> "RButton" or A_TimeSincePriorHotkey > 400)    ; The 400 is the maximum milliseconds between clicks.  Adjust if needed.
{
    StartTime := A_TickCount
    KeyWait, RButton
    If A_TickCount - StartTime > 500    ; Detect if you held the button down for more than 500 milliseconds
        Send YourKeysHere
    Return
}
Send YourKeysHere
Return
 
#IfWinActive    ; This allows any additional hotkeys below this point to function in other windows.