(an alternative to mouse gestures)
This has been a great productivity booster for me for a long time and I want to
share it, but something similar may have popped up here so it may not be big
news. I realize that PowerPro can now also recognize mouse gestures, but for 5
button mice, this should be easier and more precise, at least it is for me.
Plus you get the "hold button and don't move mouse" function that doesn't
involve any gesturing. Anyway, I hope someone may find this useful.
First you'll need to set up the Mousetrap plugin to check for the respective
mouse buttons (I use a version of this script for buttons 3-5) being clicked or
held. Here is an example of my mousetrap.ini entries (on my mouse it's the
lower thumb button):
bigthumb=0,0,0,ANY,4MD,,,run.s_BIGTHUMB,1,1,0,0,0,
bigthumb=0,0,0,ANY,4MU,,,released=1,1,1,0,0,0,
Here is the script. In the example of my mouse button #4, it is called
"s_BIGTHUMB". I'm no programmer and it was distilled from a commandlist, so
it's in poor shape, but you'll get the idea:
;Initial assignments
*Script Assign released 0
*Script Assign x xmouse
*Script Assign y ymouse
*Script Assign MoveDist 30
; Change colour of bar button to provide visual feedback of button currently
being pressed
*Format Item item 5 list "B_TB_Info" owntext 1 ownback 1 colorback 4227327
colortext 0
; Count hold duration
*Script For (County=0;not released;County=County+1)
wait.for(1)
*Script Endfor
; Restore colour of bar button to indicate release of button
*Format Item item 5 list "B_TB_Info" owntext 0 ownback 0 colorback 0 colortext
14811135
; Calculate distance mouse moved
*Script Assign dx trim(x-xmouse,"-",1)
*Script Assign dy trim(y-ymouse,"-",1)
; Decide if button was held rather than just pressed - you can adjust the delay
to your own liking
*Script If (County gt 17)do
; If held AND moved more than a negligible number of pixels, jump to @Moved
below
*Script If (xmouse le x-MoveDist or xmouse gt x+MoveDist or ymouse le
y-MoveDist or ymouse gt y+MoveDist)do
*Script Jump Moved
*Script Endif
; If held and NOT moved significantly
; >>>>>> insert what you want to happen here
; End button held part
*Script Endif
; If button not held, i.e. just clicked
; >>>>>> insert what you want to happen here
; Script jumps here if button was HELD AND mouse MOVED
@Moved
; Mouse moved straight upward while button held
*Script If ((ymouse le y) and (dy gt 3*dx))do
; >>>>>> insert what you want to happen here
*Script Quit
*Script Endif
; Mouse moved straight downward while button held
*Script If ((ymouse gt y) and (dy gt 3*dx))do
; >>>>>> insert what you want to happen here
*Script Quit
*Script Endif
; Mouse moved up and left ("northwest") while button held
*Script If ((xmouse le x and ymouse le y) and (dy le 3*dx) and not (dx gt
3*dy))do
; >>>>>> insert what you want to happen here
*Script Quit
*Script Endif
; Mouse moved down and left ("southwest") while button held
*Script If ((xmouse le x and ymouse gt y) and (dy le 3*dx) and not (dx gt
3*dy))do
; >>>>>> insert what you want to happen here
*Script Quit
*Script Endif
; Mouse moved up and right ("northeast") while button held
*Script If ((xmouse gt x and ymouse le y) and (dy le 3*dx) and not (dx gt
3*dy))do
; >>>>>> insert what you want to happen here
*Script Quit
*Script Endif
; Mouse moved down and right ("southeast") while button held
*Script If ((xmouse gt x and ymouse gt y) and (dy le 3*dx) and not (dx gt
3*dy))do
; >>>>>> insert what you want to happen here
*Script Quit
*Script Endif
; Mouse moved left while button held
*Script If ((xmouse le x) and (dx gt 3*dy))do
; >>>>>> insert what you want to happen here
*Script Quit
*Script Endif
; Mouse moved right while button held
*Script If ((xmouse gt x) and (dx gt 3*dy))do
*Script Quit
*Script Endif