Author Topic: Having Trouble With Hold Key  (Read 903 times)

gamesturbator

  • Newbie
  • *
  • Posts: 40
Having Trouble With Hold Key
« on: December 01, 2022, 06:46:05 PM »
Under "Press and Release Keys" there is a box that says "Hold Down For" x-amount of seconds. I am trying to hold a key, which is my VOIP key, for 9 seconds so that when I execute a Voicemod sound effect that's about 9 seconds I don't have to physically hold the button to transmit the sound.

It looks simple enough but it's just not working for me. Am I misunderstanding what that is for? 




Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Having Trouble With Hold Key
« Reply #1 on: December 01, 2022, 08:22:20 PM »
If the P key press is dependent on the other keys to occur before it, the key events may be happening too quickly.  You will need some add pauses like this:

Press down NumPad Enter key
Pause 0.1 seconds
Press down NumPad 6 key
Pause 0.1 seconds
Release NumPad Enter key
Release NumPad 6 key
Pause 0.1 seconds
Press down P key and hold for 9 seconds and release   

You can also try breaking up the Press P key into three parts (although this is done for you behind the scenes):
Press down P key
Pause 9 seconds
Release P key


Note also that a pause of 0.1 is a suggestion - you could probably get by with a shorter pause.

Hope that helps!

gamesturbator

  • Newbie
  • *
  • Posts: 40
Re: Having Trouble With Hold Key
« Reply #2 on: December 02, 2022, 02:36:18 AM »
I even made a command dedicated to just P to see if I could get it to work, but it just pressed and released it instead of holding it for 9 seconds. Something doesn't seem right there.

 The sound files take a moment to execute, which is why I placed the P after them. Those combo keys are button assignments (I've made dozens) to run specific sound files and would not work if there were pauses between them.

I'm running the latest version if that helps at all. I've got covid right now and need to sleep. It's been a rough 4 days. So this is a tomorrow problem for now. 😎

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4785
  • RTFM
Re: Having Trouble With Hold Key
« Reply #3 on: December 02, 2022, 02:55:41 AM »
How are you testing the hold down time? Note that virtual keypresses do not cause character repeats. E.G. if you open Notepad and execute the command that holds down 'P', that will only result in a single 'p' character shown in Notepad.

gamesturbator

  • Newbie
  • *
  • Posts: 40
Re: Having Trouble With Hold Key
« Reply #4 on: December 02, 2022, 11:17:28 AM »
Well, that's disappointing!  I've wasted so much time over the years using notepad, etc. to test keypresses, not just with Voiceattack. 🤣 Maybe I should use Windows virtual keyboard to test it. Or do you have a better suggestion? Thanks!

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4785
  • RTFM
Re: Having Trouble With Hold Key
« Reply #5 on: December 02, 2022, 11:36:44 AM »
DIView can show keypresses and the delta between presses and releases.

Two main caveats: Keypresses are only shown when a press precedes a release. I.E. using a keypress action set to "Release Key(s)" will not have a visible effect in that utility unless it was preceded by a press (E.G. from another keypress action, or a physical keyboard)
And, the timing isn't millisecond-accurate (being DirectX-based, I'm assuming this is because of polling).

gamesturbator

  • Newbie
  • *
  • Posts: 40
Re: Having Trouble With Hold Key
« Reply #6 on: December 02, 2022, 11:50:05 AM »
Well, I did an online keyboard test and it definitely worked. So I was blaming VA for nothing. 🙃 Thanks for helping me to understand why my tests weren't working.