Author Topic: Have one button held down and it holds down a different one  (Read 1516 times)

Conclavice

  • Newbie
  • *
  • Posts: 10
  • All Hail Pfiel
Have one button held down and it holds down a different one
« on: February 10, 2021, 12:23:38 PM »
sorry if the title is a bit confusing but I basically want to hold a certain mouse button and then it will hold down the alt key, I'm not sure how to do this.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Have one button held down and it holds down a different one
« Reply #1 on: February 10, 2021, 01:35:18 PM »
You can use a loop for that to do it with a single command (the alternative would be to have one command trigger on the press of the button, and another on release).

E.G.
Code: [Select]
Press down Left Alt key
Start Loop While :  Middle Mouse Button Is Pressed
End Loop
Release Left Alt key

Conclavice

  • Newbie
  • *
  • Posts: 10
  • All Hail Pfiel
Re: Have one button held down and it holds down a different one
« Reply #2 on: February 10, 2021, 04:47:41 PM »
You can use a loop for that to do it with a single command (the alternative would be to have one command trigger on the press of the button, and another on release).

E.G.
Code: [Select]
Press down Left Alt key
Start Loop While :  Middle Mouse Button Is Pressed
End Loop
Release Left Alt key

So what would execute that command, middle mouse in that example or something else?

also this is what I've got and it didn't seem to work

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Have one button held down and it holds down a different one
« Reply #3 on: February 10, 2021, 05:06:02 PM »
The middle mouse button in the example, but it can be any of the available mouse buttons; the loop just needs to check the same button you use to trigger the command.

What you have in your screenshot looks correct; what doesn't appear to be working?

Note that if the "Do not allow button event to be passed through" option is enabled, the loop cannot detect the button press

Conclavice

  • Newbie
  • *
  • Posts: 10
  • All Hail Pfiel
Re: Have one button held down and it holds down a different one
« Reply #4 on: February 10, 2021, 05:42:15 PM »
The middle mouse button in the example, but it can be any of the available mouse buttons; the loop just needs to check the same button you use to trigger the command.

What you have in your screenshot looks correct; what doesn't appear to be working?

Note that if the "Do not allow button event to be passed through" option is enabled, the loop cannot detect the button press

Yeah I think I've got everything correct. it shows that the command "alt" is used but it wont actually do anything


Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Have one button held down and it holds down a different one
« Reply #5 on: February 10, 2021, 05:45:30 PM »
How are you testing?

If you hold down the mouse button on the desktop, does pressing the Tab key on your keyboard bring up the task switcher?

Conclavice

  • Newbie
  • *
  • Posts: 10
  • All Hail Pfiel
Re: Have one button held down and it holds down a different one
« Reply #6 on: February 10, 2021, 08:02:30 PM »
How are you testing?

If you hold down the mouse button on the desktop, does pressing the Tab key on your keyboard bring up the task switcher?

Yeah it does, so its an issue with something else. what do I do about that

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Have one button held down and it holds down a different one
« Reply #7 on: February 10, 2021, 08:05:42 PM »
That depends, what is "something else"? Which application are you targeting?

If pressing "Tab" works, VoiceAttack is sending the keypress, as instructed.