I'm about to solve a little challenge. I want to make a script to prevent a user to click within a specific area in a program. In this particular case, it is Firefox and it's tool/bookmark toolbar.
The script is easy enough:
Code: Select all
#ifWinActive, ahk_class MozillaWindowClass LButton:: MouseGetPos, musX, musY If (musY < 131) MouseMove, musX, 130 Else Click Return RButton:: MouseGetPos, musX, musY If (musY < 131) MouseMove, musX, 130 Else Click right Return
1. It's not possible to trag the mouse in browser window. The click doesn't keep the mouse button down. That makes it impossible to select any text with the mouse.
2. If the user change the active window, it will still be possible to click on the area because Firefox won't be the active window while the user click's the mouse. That way the user might go around the limitation I wish to set.