Author Topic: How to make a long press command?  (Read 1989 times)

Yilmoto

  • Newbie
  • *
  • Posts: 4
How to make a long press command?
« on: November 18, 2020, 07:06:59 PM »
I'm disabled and having trouble figuring out how to do this. I'm trying to make the right mouse button do a click on a short press and the r key on a long press.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: How to make a long press command?
« Reply #1 on: November 18, 2020, 07:20:45 PM »
Unfortunately stopping the mouse button click from getting passed through to other applications also prevents reading its state (this is a Windows API restriction, not VoiceAttack specific), which is required for detecting a long press, so the closest you can get using a mouse button is to have it click on short press and click and press R on a long press.


If you have a mouse that comes with software that allows you to rebind the right mouse button to press a keyboard key, that would allow you to use the "When I press keys" feature instead, the underlying Windows API for which does allow both blocking passthrough and reading the state.

A rarely or never-used key would be best for that; The F13 to F24 keys, which aren't physically present on most modern keyboards, would be ideal, but not all software allows you to map those.
You can try having VoiceAttack press one of them when your mouse software asks you to press a keyboard key to assign it to a given mouse button (presuming that is how it functions).

iceblast

  • Sr. Member
  • ****
  • Posts: 372
Re: How to make a long press command?
« Reply #2 on: November 19, 2020, 02:59:23 PM »
Another option would be to get a mouse with a lot of buttons.

The Logitech G600 Mouse has 20 buttons. I've been using it for years with Voiceattack. It's a great mouse, and you can program so many different commands for each program with Voiceattack.

Here's a link to the mouse, it's also pretty inexpensive, and you'll probably be able to pick it up for around $25 sometime this month for Black Friday.

https://www.amazon.com/Logitech-Gaming-Backlit-Programmable-Buttons/dp/B0086UK7IQ/ref=sr_1_2?crid=16GY6KWW5U41H&dchild=1&keywords=logitech+g600+mmo+gaming+mouse&qid=1605822863&sprefix=Logitech+G600%2Caps%2C145&sr=8-2