Author Topic: Is it possible to Activate a Command with Left Shift + Left Click?  (Read 945 times)

Usidor

  • Newbie
  • *
  • Posts: 10
Is it possible to Activate a Command with Left Shift + Left Click?
« on: September 01, 2022, 04:15:47 PM »
I would like to set up a command that would execute when using left shift + Left Click.

Is this possible?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Is it possible to Activate a Command with Left Shift + Left Click?
« Reply #1 on: September 01, 2022, 04:20:57 PM »
Different trigger methods cannot be combined directly (I.E. by using a combination of "When I" options; those function independently), but you could set up a command to trigger off of one, then check for the other.


As the second part of your combination is the left mouse button, which you're presumably going to use more often than the left Shift key, you may want to have the command trigger off the latter, and wait in a loop for the former.
E.G.
Code: [Select]
Start Loop While :  Keyboard Key 'Left Shift' Is Pressed
    Begin Device State Check :  Left Mouse Button Is Pressed
        Write [Blue] 'Left Shift + left mouse button detected' to log
    End Condition - Exit when condition met
End Loop

The main alternative would be to do it the other way around, and have the command trigger off of the left mouse button then check whether the left Shift key is pressed, which doesn't require a loop but would trigger the command every time you click the button.

Usidor

  • Newbie
  • *
  • Posts: 10
Re: Is it possible to Activate a Command with Left Shift + Left Click?
« Reply #2 on: September 01, 2022, 04:35:57 PM »
Thank you! Worked perfectly. I was close but was missing the loop.