Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Include <_Struct>
- ~Shift::MouseKeys(0) ;Disable MOUSEKEYS
- ~Shift UP::MouseKeys(1) ;Enable MOUSEKEYS
- ^!Space::MsgBox % "MouseKeys are " (MouseKeys(-1) ? "On" : "Off")
- Numpad2::MsgBox
- MouseKeys(OnOff=0){
- static MOUSEKEYS:="DWORD cbSize,DWORD dwFlags,DWORD iMaxSpeed,DWORD iTimeToMaxSpeed,DWORD iCtrlSpeed,DWORD dwReserved1,DWORD dwReserved2"
- ,SPI_GETMOUSEKEYS:=0x0036,SPI_SETMOUSEKEYS:=0x0037
- MK:=Struct(MOUSEKEYS),MK.cbSize:=Struct(MK)
- DllCall("SystemParametersInfo", UInt, SPI_GETMOUSEKEYS, "UInt", MK.cbSize, "UInt", MK[""], "UInt", 0)
- If OnOff=-1
- MK.dwFlags:=MK.dwFlags+((MK.dwFlags & 1)?-1:1)
- else if OnOff
- MK.dwFlags:=MK.dwFlags+((MK.dwFlags & 1)?0:1)
- else
- MK.dwFlags:=MK.dwFlags+((MK.dwFlags & 1)?-1:0)
- Loop 2
- DllCall("SystemParametersInfo", UInt, Mod(A_Index,2)?SPI_SETMOUSEKEYS:SPI_GETMOUSEKEYS, "UInt", MK.cbSize, "UInt", MK[""], "UInt", 0)
- Return (MK.dwFlags & 1)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement