Code: Select all
;-------------------------------------------------------------------------------
#If isMousePos("TopRight") ; context for the following hotkeys
;-------------------------------------------------------------------------------
WheelUp:: SendInput, {Volume_Up}
WheelDown:: SendInput, {Volume_Down}
#If ; end of context
;-------------------------------------------------------------------------------
isMousePos(Position, maxDistance := 10) { ; return true if mouse is in position
;-------------------------------------------------------------------------------
CoordMode, Mouse, Screen
MouseGetPos, MouseX, MouseY
; check all the edges
if InStr(Position, "Left") and (maxDistance < MouseX)
return False
if InStr(Position, "Top") and (maxDistance < MouseY)
return False
if InStr(Position, "Right") and (maxDistance < A_ScreenWidth - MouseX)
return False
if InStr(Position, "Bottom") and (maxDistance < A_ScreenHeight - MouseY)
return False
; still here?
return True
}
the code i cud come up with this is given below..but it does not seem to activate when the mouse position is bottom right..however if i add another trigger (eg LButton:: ) then the script runs...clearly i am missing something here..if somebody can help me i wud be very greatful
Code: Select all
;-------------------------------------------------------------------------------
#If isMousePos("TopRight") ; context for the following hotkeys
;-------------------------------------------------------------------------------
SendInput, #d
#If ; end of context
;-------------------------------------------------------------------------------
isMousePos(Position, maxDistance := 10) { ; return true if mouse is in position
;-------------------------------------------------------------------------------
CoordMode, Mouse, Screen
MouseGetPos, MouseX, MouseY
; check all the edges
if InStr(Position, "Left") and (maxDistance < MouseX)
return False
if InStr(Position, "Top") and (maxDistance < MouseY)
return False
if InStr(Position, "Right") and (maxDistance < A_ScreenWidth - MouseX)
return False
if InStr(Position, "Bottom") and (maxDistance < A_ScreenHeight - MouseY)
return False
; still here?
return True
}