Thank you
Code: Select all
#SingleInstance,Force
#NoEnv
Auth_RunAsAdmin()
#MaxThreadsPerHotkey 1
#MaxThreads 200
SetWorkingDir %A_ScriptDir%
Auth_RunAsAdmin()
{
Global
If ( !A_IsAdmin ) {
Loop, %0% ; For each parameter
sParams .= A_Space . %A_Index%
Local ShellExecute
ShellExecute := (A_IsUnicode) ? "Shell32.dll\ShellExecute" : "Shell32.dll\ShellExecuteA"
A_IsCompiled
? DllCall( ShellExecute, UInt,0, Str,"RunAs", Str,A_ScriptFullPath, Str,sParams , Str,A_WorkingDir, Int,1 )
: DllCall( ShellExecute, UInt,0, Str,"RunAs", Str,A_AhkPath, Str,"""" A_ScriptFullPath """ " sParams
, Str,A_WorkingDir, Int,1 )
ExitApp
}
}
/*
CURSORINFO
(
DWORD cbSize; offset 0, size 4 bytes long
DWORD flags; offset 4, size 4 bytes long
HCURSOR hCursor; offset 8, size 4-8 bytes long
POINT ptScreenPos; offset 12-16, size 8 bytes long
)"
Total size = (8 + 16) for 64bit or (4 + 16) for 32bit
*/
; We only care about if the mouse is hidden or not
; returns True if Hidden
isMouseHidden()
{
; struct to check mouse status (compatible with 32 or 64bits)
c_msize := VarSetCapacity(g_mi, A_PtrSize + 16, 0)
NumPut(c_msize, g_mi, "UInt") ; Set size of the struct
DllCall("GetCursorInfo", "UPtr", &g_mi)
return !NumGet(g_mi, 4, "UInt") ; mouse flags 0 == Hidden, >0 if not
}
; Hotkeys for game
#IfWinActive, Black Desert Online
{
^s::Suspend
LButton::
if (isMouseHidden())
send {Blind}{r down}
else
send {Blind}{click down}
return
~LButton up::
if (isMouseHidden())
send {Blind}{r up}
else
send {Blind}{click up}
return
RButton::
if (isMouseHidden())
send {Blind}{t down}
else
send {Blind}{click down right}
return
~RButton up::
if (isMouseHidden())
send {Blind}{t up}
else
send {Blind}{click up right}
return
}