Change the sensitivity of the mouse cursor with a button Topic is solved

Ask gaming related questions
Atisab
Posts: 5
Joined: 28 Feb 2024, 17:20

Change the sensitivity of the mouse cursor with a button

07 Mar 2024, 10:59

Hi, i found a simple solution. I am now looking for a script with which I can change the sensitivity of the mouse with a button. This should work as follows: If I hold down the T key, the mouse cursor should slow down by one step as long as the key is held down. And when I release the T key, the mouse sensitivity returns to the standard normal speed. Hold down the T key = Mouse cursor one step slower. Release the T key, the mouse cursor sensitivity returns to the standard normal speed. With this script it would be easier to hit the opponents in first person shooter games. I think something like this is feasible with Autohotkey
gregster
Posts: 9103
Joined: 30 Sep 2013, 06:48

Re: Change the sensitivity of the mouse cursor with a button

07 Mar 2024, 11:24

I moved your topic from 'Tutorials (v2)' to 'Ask for Help (v2) > Gaming', like I suggested in the other v2 topic - and also linked to.
The 'Tutorials' subforums are not for help requests, but for posting actual tutorials.

Edit: Now I saw that you also posted a duplicate in the AHK v1 Gaming help subforum. If you prefer, and you actually use AHK v1, we can move this topic again.
Last edited by gregster on 07 Mar 2024, 11:27, edited 1 time in total.
User avatar
mikeyww
Posts: 27301
Joined: 09 Sep 2014, 18:38

Re: Change the sensitivity of the mouse cursor with a button  Topic is solved

11 Mar 2024, 08:34

Code: Select all

; This script gets or sets the mouse speed
; Range is 1-20, 10 is default
; https://autohotkey.com/board/topic/8432-script-for-changing-mouse-pointer-speed/
#Requires AutoHotkey v2.0

t:: {
 Static slow := 4 ; Range is 1-20
 orig := getMouseSpeed(), setMouseSpeed(slow)
 ToolTip '===> SLOW <===', 500, 500
 KeyWait(ThisHotkey), setMouseSpeed(orig)
 ToolTip
}

getMouseSpeed() {
 Static SPI_GETMOUSESPEED := 0x70
 DllCall('SystemParametersInfo', 'UInt', SPI_GETMOUSESPEED, 'UInt', 0, 'Ptr*', &speed := 0, 'UInt', 0)
 Return speed
}

setMouseSpeed(speed) {
 Static SPI_SETMOUSESPEED := 0x71
 DllCall('SystemParametersInfo', 'UInt', SPI_SETMOUSESPEED, 'UInt', 0, 'UInt', speed, 'UInt', 0)
}
viewtopic.php?f=94&t=127034

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 7 guests