Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mouse triggers question
#1
Hello again, and thank you for all your help thus far

I'm trying to perform a mouse trigger, separately when the left mouse button+Ctrl are pressed and separately and when they are released.

I attempted the following in the mouse trigger module:
        Triggers.Mouse[TMClick.Left,"Ctrl"]= o => {   
            /////code////;
            /////code////;
            /////code////;
            print.it(mouse.isPressed(MButtons.Left));
            mouse.waitForNoButtonsPressed();
            /////more code code////;
            /////more code code////;
            };

Then pressing and holding left mouse button, but apparently print.it(mouse.isPressed(MButtons.Left) returns false even as I continue to press and hold

Also, using separately the following mouse triggers don't seem to work:
Triggers.Mouse[TMClick.Left,"Ctrl"]= o => /////code////;
Triggers.Mouse[TMClick.Left,"Ctrl",TMFlags.ButtonModUp]= o => /////code////;

Thanks in advance as always
#2
Use TMFlags.ShareEvent. Without it the trigger does not allow the OS to set the logical "pressed" state, therefore mouse.waitForNoButtonsPressed does not work. OS does not provide a way to get the physical "pressed" state. But with the flag the mouse event is not blocked.
 
Code:
Copy      Help
        Triggers.Mouse[TMClick.Left, "Ctrl", TMFlags.ShareEvent] = o => {
            print.it(mouse.isPressed(MButtons.Left));
            mouse.waitForNoButtonsPressed();
            print.it("mouse button released");
        };
#3
If need to block the event, use mouse.waitForClick.

Code:
Copy      Help
        Triggers.Options.ThreadNew();
        Triggers.Mouse[TMClick.Left, "Ctrl"] = o => {
            print.it("mouse button pressed");
            mouse.waitForClick(0, up: true, block: true);
            print.it("mouse button released");
        };

        Triggers.Options.Thread();
#4
Thank you so much!


Forum Jump:


Users browsing this thread: 1 Guest(s)