Author Topic: Press and Hold Key Not Working  (Read 4429 times)

DeWolf

  • Guest
Press and Hold Key Not Working
« on: August 19, 2017, 12:36:50 PM »
Running a registered version 1.6.7 of Voice Attack.
Using a Steelseries 7G keyboard though the ps/2 connection on Windows 10.

I set up a simple command 'Press and hold J key for 3 seconds and release'.
When I have notepad open as the active window and run the command, it presses the J key and only a single J is typed. I get the same result if I change the command to 'Press down J key', a single J is typed and that's it.
The only way to get the key to stay active is to  check the box 'This command repeats continuously'.
What am I doing wrong?



Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Press and Hold Key Not Working
« Reply #1 on: August 19, 2017, 01:24:30 PM »
Virtual keypresses don't activate the windows "Character repeat" feature. If you want multiple characters typed, you need to specify them explicitly.

However, to a videogame this shouldn't matter. If the key is held down, virtual or not, it would register as such.

DeWolf

  • Guest
Re: Press and Hold Key Not Working
« Reply #2 on: August 19, 2017, 03:09:18 PM »
I also own VAC (Voice Activated Commands). Having the same issue as with Voice Attack. I'm guessing it's something in Windows causing this.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Press and Hold Key Not Working
« Reply #3 on: August 19, 2017, 03:32:31 PM »
As Pfeil was saying, repeating keys (down, up, down, up, down, up) is an effect of the hardware and Windows.  The virtual key presses (key presses through the API which VA uses) does not repeat (thankfully... it would be unusable if it did).  In order to simulate that, you'll need to create a command that loops and presses/releases keys.

DeWolf

  • Guest
Re: Press and Hold Key Not Working
« Reply #4 on: August 19, 2017, 04:40:26 PM »
Got everything working. Thanks for the feedback.