Skip to content

Commit

Permalink
Update grid.au3
Browse files Browse the repository at this point in the history
  • Loading branch information
user726687 authored Oct 16, 2022
1 parent f7f2fc9 commit d9f4da9
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions grid.au3
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Func SingletonOverlay($msg=null,$arg=null)
With $state
Switch $msg
Case 'init'
$hOverlay = GUICreate("Overlay",@DesktopWidth,@DesktopHeight,0,0,0x80000000,0x02080080)
$hOverlay = GUICreate("Overlay",@DesktopWidth,@DesktopHeight,0,0,0x80000000,0x02080088)
$hFrame = GUICtrlCreateButton("",0,0,@DesktopWidth,@DesktopHeight)
GUISetBkColor(0xe1e1e1,$hOverlay)
DllCall("user32.dll", "bool", "SetLayeredWindowAttributes", "hwnd", $hOverlay, "INT", 0x00e1e1e1, "byte", 255, "dword", 0x03)
Expand All @@ -59,46 +59,39 @@ Func SingletonOverlay($msg=null,$arg=null)
.right = Int((.left+.right)/2)
GUICtrlSetPos($hFrame,.left,.top,.right-.left,.bottom-.top)
MouseMove( Int((.left+.right)/2), Int((.top+.bottom)/2), 0 )
GUISetState(@SW_RESTORE,$hOverlay)
EndIf
Case 'I'
If .active Then
.bottom = Int((.top+.bottom)/2)
.left = Int((.left+.right)/2)
GUICtrlSetPos($hFrame,.left,.top,.right-.left,.bottom-.top)
MouseMove( Int((.left+.right)/2), Int((.top+.bottom)/2), 0 )
GUISetState(@SW_RESTORE,$hOverlay)
EndIf
Case 'J'
If .active Then
.top = Int((.top+.bottom)/2)
.right = Int((.left+.right)/2)
GUICtrlSetPos($hFrame,.left,.top,.right-.left,.bottom-.top)
MouseMove( Int((.left+.right)/2), Int((.top+.bottom)/2), 0 )
GUISetState(@SW_RESTORE,$hOverlay)
EndIf
Case 'K'
If .active Then
.top = Int((.top+.bottom)/2)
.left = Int((.left+.right)/2)
GUICtrlSetPos($hFrame,.left,.top,.right-.left,.bottom-.top)
MouseMove( Int((.left+.right)/2), Int((.top+.bottom)/2), 0 )
GUISetState(@SW_RESTORE,$hOverlay)
EndIf
Case 'M'
If .active Then
MouseClick( 'left', Int((.left+.right)/2), Int((.top+.bottom)/2), 1, 0 )
SingletonOverlay('deactivate')
EndIf
Case ','
If .active Then
MouseClick( 'middle', Int((.left+.right)/2), Int((.top+.bottom)/2), 1, 0 )
SingletonOverlay('deactivate')
EndIf
Case '.'
If .active Then
MouseClick( 'right', Int((.left+.right)/2), Int((.top+.bottom)/2), 1, 0 )
SingletonOverlay('deactivate')
EndIf
EndSwitch
EndWith
Expand Down

0 comments on commit d9f4da9

Please sign in to comment.