Change Cursor Color when CTRL is pressed

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
taddypole
Posts: 7
Joined: 08 Jan 2023, 09:20

Change Cursor Color when CTRL is pressed

Post by taddypole » 22 Apr 2024, 15:52

I'm trying to create a script to change the mouse cursor color when the control key is pressed. It will then change the color back to the original color when the control key is released.
There are no error and it seems to flow through the code but the cursor color doesn't change.
Any ideas?

Code: Select all

#Persistent
#SingleInstance Force

SetTimer, ChangeCursor, 100

ChangeCursor:
    If GetKeyState("Ctrl", "P") ; Check if Control key is pressed
    {
        ; Change cursor color to blue
        DllCall("SystemParametersInfo", UInt, 0x0057, UInt, 0, UInt, 0, UInt, 3)
    }
    Else
    {
        ; Restore default cursor color
        DllCall("SystemParametersInfo", UInt, 0x0057, UInt, 0, UInt, 0, UInt, 0)
    }
Return
[Mod edit: Added [code][/code] tags. Please use them yourself when posting code!]

Return to “Ask for Help (v1)”