Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
perform actions during mouse drag when Eat is checked
I have a macro with #CAL as the mousetrigger. The window should not receive the mouse click, so I checked ‘Eat’ in the trigger dialog. ‘When released’ is unchecked because the macro has to start immediately and has to perform some actions (draw a rectangle with OnScreenDraw based on the mousecoordinates while the mouse is being dragged) while the mouse button is down and stop when the mouse button is released (and then perform some more actions).
How can I detect when the mousebutton has been released?  RealGetKeyState does not work, because the mouseclick has been ‘eaten’.   Waiting with  wait(0 ML) does work, but then the macro can’t perform any actions during the waiting period.  
  • macro has to start on mouseclick,  ‘Eat’ must be checked,  ‘When released’ must be unchecked.
  • macro has to perform actions while the mouse button is physically down, and stop when the mouse button is released. (The mouse is dragged during this time)
  • RealGetKeyState does not detect that the mouse button is physically down when ‘Eat’ is checked in trigger dialog.
  • wait (0 ML)   does detect when mouse button is released but then no actions can be performed during the dragging of the mouse.
How can I detect the mouse up event in such a way that the macro can perform actions during the dragging of the mouse and waiting for mouse up?  Any help would be much appreciated.
Option 1: perform actions in other thread.
Option 2: in the macro use a low-level mouse hook.

Macro Macro514
Trigger #CAL 0x8     Help - how to add the trigger to the macro
Copy      Help
int ht=mac("sub.Actions")
wait 0 ML
EndThread "" ht

#sub Actions
mes "Actions"
It works!  Thank you!

Forum Jump:

Users browsing this thread: 1 Guest(s)