Author Topic: Having a problem with a keypress, and hold.  (Read 2002 times)

iceblast

  • Sr. Member
  • ****
  • Posts: 372
Having a problem with a keypress, and hold.
« on: December 21, 2023, 05:40:27 PM »
From what I understand, in order to have VoiceAttack press and hold a button, I have to make a loop command. Though, not sure why this can't be done with a internal option, like repeat, but without the pulsing, instead of relying on a loop... Would be a lot easier...

I'm using Dragon Natually Speaking for Dictation. I want to make a command that when I hit the Pause button, it turns the mic on for Dragon, and off when I release it. Now this works, but VA isn't reading the Release Left Ctrl+Left Alt+Left Shift+/ ? keys, so at least the Shift key is still being held down, and I can't click on any program tabs on the taskbar, without opening new instances of that program. I apparently, have to directly hit the stop button on VA to stop the command, even my Emergency stop VA commands aren't working. smh

Code: [Select]
Start Loop While :  Keyboard Key 'Pause' Is Pressed
    Press down Left Ctrl+Left Alt+Left Shift+/ ? keys
End Loop
Release Left Ctrl+Left Alt+Left Shift+/ ? keys

Now, I was told a long time ago, that this was the only way to hold a key down in VA, and for it to release after you take your finger off the button. I don't know if there is a better way than this, but VA isn't completely this command properly, but it's not releasing all the keys. It's a bit frustrated. :)

I don't know if this is a bug, or if I'm doing something wrong, or if there is a better way to do this now.

Hope there is a solution. ;)

Thanks!

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2827
Re: Having a problem with a keypress, and hold.
« Reply #1 on: December 21, 2023, 06:31:17 PM »
Heya, bud - good to hear from you.

You should just be able to do this:

Press down Left Ctrl + Left Alt + Left Shift + /? keys

Start Loop While: Keyboard Key 'Pause' Is Pressed
End Loop

Release Left Ctrl + Left Alt + Left Shift + /? keys


Or (what I would do) - you can have two commands that work on the key down and release of the pause button.  The command that is triggered on key down of the pause button simply has "Press down Left Ctrl + Left Alt + Left Shift + /? keys", and the command that triggers on the key up (release) of the pause button would simply have "Release Left Ctrl + Left Alt + Left Shift + /? keys"  No loop required.

Hope that helps!


iceblast

  • Sr. Member
  • ****
  • Posts: 372
Re: Having a problem with a keypress, and hold.
« Reply #2 on: December 22, 2023, 09:55:06 AM »
That makes sense, I guess I was doing it wrong. smh I knew it was something like that... :)

iceblast

  • Sr. Member
  • ****
  • Posts: 372
Re: Having a problem with a keypress, and hold.
« Reply #3 on: December 22, 2023, 02:50:50 PM »
Still having the same problem. VA isn't releasing the keys. At least the Shift key is still being held down. I even used the command 'release all keys' in the command, and it doesn't work. I have to literally click on Stop on VA to get the keys to release, and it's says the command stopped then. It's very odd.

I tried the 2 commands as well, and I had no luck.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4763
  • RTFM
Re: Having a problem with a keypress, and hold.
« Reply #4 on: December 23, 2023, 12:03:46 AM »
Does the Shift key remain pressed if Dragon is not running while you execute the VoiceAttack commands?

iceblast

  • Sr. Member
  • ****
  • Posts: 372
Re: Having a problem with a keypress, and hold.
« Reply #5 on: December 23, 2023, 07:09:00 AM »
I don't know, I haven't tried that. Though Dragon doesn't press any keys, and the mic icon is shown as Off. It makes me think it's not the problem.

There is something going on with one of my commands for some reason.

My Dragon command works fine for a few tries with no problems, then suddenly, the shift button is stuck. I'm beginning to wonder if the problem is coming from a different command. Because I have another command that's acting up for some reason.

This is a new computer, and I'm still getting the bugs out of it. This computer is 9x faster than my last. :) Though single thread, I guess makes it only little more than twice as fast. :)

I'll report back, if I'm still having the problem.

SemlerPDX

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 280
  • Upstanding Lunatic
    • My AVCS Homepage
Re: Having a problem with a keypress, and hold.
« Reply #6 on: December 23, 2023, 12:17:40 PM »
...
There is something going on with one of my commands for some reason.

My Dragon command works fine for a few tries with no problems, then suddenly, the shift button is stuck. I'm beginning to wonder if the problem is coming from a different command. Because I have another command that's acting up for some reason.
...

You can find all commands which may press the Shift key by entering this as the keyword in the Filters box - the list of commands will shorten to only include those commands with this 'Shift' keyword in the actions list, which should identify commands pressing this key:


iceblast

  • Sr. Member
  • ****
  • Posts: 372
Re: Having a problem with a keypress, and hold.
« Reply #7 on: December 23, 2023, 07:48:04 PM »
Turns out that it was Dragon Naturally Speaking that was the problem. I would press Pause, and after saying a few words, it would print the few words, and it would turn off the mic, and lock all the function keys. I usually only use Dragon for 1 word. Usually a word I didn't know how to spell. So I never knew it was turning off the mic and locking down the function keys by it's self. I was releasing the button to fast. SMH

I had a command I thought was running, release all keys when I press it, but in it, if any of the functions keys were held down, it wouldn't do anything, which was defeating the point. I didn't realize, till I looked at the command for something else. SMH

So anyway. Dragon does have a Mic On/Off button, which I've been using with Pause for years, but I wanted to use the push and hold for mic command instead. Well, I'm now able to use the On/Off command instead, as a Press and Hold button, after battling this issue. So at least I learned something. :)

Well, anyway, thanks for the help again!