Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trigger - if mouse button held for certain period of time?
#1
HI Gintaras,
Thank you for your super quick responses on my flood of questions.
Can a trigger be if a key or mouse click is held down for a certain period of time?
Sometimes middle mouse triggers can get triggered when using the mouse wheel.
It would be nice to make it a little harder to activate - i.e. held down for 0.5 sec or something

Thanks,
Stuart
#2
Assign new filter function:

Code:
Copy      Help
;/
function# iid FILTER&f

int+ g_mousembtime=GetTickCount
ret iid

In the macro, insert this at the beginning:

Code:
Copy      Help
int+ g_mousembtime
if(GetTickCount-g_mousembtime<500) ret

Here 500 is number of milliseconds from button down to up.
#3
Once I get a hang of this, This will improve the stability of my macros in a very dynamic environment by filtering them to their specific application!
THanks again,
S
#4
Some Multimice button return key-combinations assigned to them. I would love to have this filtering function but with a key-combo instead, which is what my Mouse button 5 delivers (specifically 'CA1)

Thanks

Stuart
#5
It should work if you assign CA1 trigger to the macro.
#6
Hi Gintaras,
I am trying to do something a bit ambitious

I have a mouse device with middle click button and 2 side buttons (buttons 4 and 5 which need to be hot-keyed to specific keys in the application I am working in but for the sake of simplicity we can call them M4 and M5)

I would like to use the mouse chord function where each of the buttons MM, M4 and M5 can be the initial trigger for a unique set of macros. i.e.

MM + M4 = macro 1
MM+ MM = macro 2
MM+ M5 = macro 3

M4 + M4 = macro 4
M4 + MM = macro 5
M4 + M5 = macro 6

M5 + M4 = macro 7........etc

When I have tried this, there seems to be a conflict with the triggers i.e. macro 4 and macro 1 are both being triggered off M4 as a second click (even though)
I have tried to write individual parallel filter functions but it doesn't seem to work

If THAT's not too hard, I would also like to have it so that if instead of mousechordng to a second button, you instead hold down for a specific periord of time, M4, MM, or M5 it runs a different Macro (i.e. not a chorded macro). You wrote me in the forum about that but I couldn't get it to work superimposed on Mouse chording.

I know this is a lot but these functions would certainly supercharge the mouse for applications where we switch among a number of different app functions (i.e. image software) over and over....


Thanks again......

Stuart
#7
I'm trying to combine the mouse hold filter with the keyboard detector filter functions.

This way on a second mouse I can use clicks and hold clicks that are not on the primary mouse.

Thanks,
Jimmy Vig
#8
Function FF_Mouse1
Trigger :     Help - how to add the trigger to the macro
Code:
Copy      Help
;/
function# iid FILTER&f


int+ g_mousembtime=GetTickCount

;Makes the macro specific to a particular mouse.
;For more info, read "Keyboard Detector Help" macro.
;

#compile Keyboard_Detector
;
if(!g_ri.mworking or !g_rir.m[0]) ret -2
SendMessage g_ri.hwnd 0 0 0
int mb=iif(f.tkey<9 f.tkey 0)
if(g_ri.mb!=mb) 0.001
if(g_ri.mb=mb)
,if(g_ri.mouse_id!=g_rir.m[0]) ret -2
else
,if(g_ri.m[0]!=mb) ret -2
,int t=GetTickCount-g_ri.mt[0]
,if(t>1000 or t<0) ret -2
g_ri.m[0]=0; ret iid
#9
Ok...$50,000 question. How do you combine all the mouse filter to make a super filter...

Time, chords, and mouse detector?

an FF_MChords/FF_Mouse1/FF_MouseHold filter function.

This would allow a mouse to be used in tons of different ways...

Thanks,
Jimmy Vig
#10
When need to assign 2 or more existing filter functions to a macro, you can instead assign new filter function that calls these filter functions. Then you don't have to edit the existing functions.

Simple example.
Here FF_A and FF_B are existing filter functions. FF_A_and_B is new filter function.
Don't forget to check "This function is a filter function" in Properties.

Macro Macro1281
Trigger CSa //FF_A_and_B     Help - how to add the trigger to the macro
Code:
Copy      Help
mes "macro"

Function FF_A_and_B
Code:
Copy      Help
;/
;Allows starting macro only in QM window AND only if Caps Lock is on.

function# iid FILTER&f

iid=FF_A(iid f); if(iid<=0) ret iid

;if need more filter functions:
;iid=FF_C(iid f); if(iid<=0) ret iid
;iid=FF_D(iid f); if(iid<=0) ret iid
;...

ret FF_B(iid f)

Function FF_A
Code:
Copy      Help
;/
;Allows starting macro only in QM window.

function# iid FILTER&f

if(wintest(f.hwnd "" "QM_Editor")) ret iid

Function FF_B
Code:
Copy      Help
;/
;Allows starting macro only if Caps Lock is on.

function# iid FILTER&f

ifk(K 1) ret iid
#11
Sweet. I guess I should have just asked the right question. That was actually the first thing that popped into my head, but I just pushed it aside thinking it wasn't the right angle. Should have trusted my instinct. Thanks for the example, I wouldn't have know how to do that on my own.

Thanks,
jimmy Vig


Forum Jump:


Users browsing this thread: 1 Guest(s)