Author Topic: Stop keys registering  (Read 1804 times)

Ozias

  • Newbie
  • *
  • Posts: 6
Stop keys registering
« on: October 07, 2023, 02:07:41 PM »
Hello, I really like this program and have got many people to purchase it, but one thing is very frustrating with it. I have my keys in game set to be different macros like my "T' key presses other keys, but not "T" in game. This makes it impossible to type things in game without first alt tabbing to click the keyboard symbol on the front of voice attack to pause it. Is there some way I can set it up to press one key in game to pause it from registering the macros so I can type text in game and then press the same key again to go back to normal macros? Thanks in advance and I think this info will help many people with the same issue! :)

SemlerPDX

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 291
  • Upstanding Lunatic
    • My AVCS Homepage
Re: Stop keys registering
« Reply #1 on: October 08, 2023, 10:35:24 AM »
"press one key in game to pause it from registering the macros"
... this is VoiceAttack  ;D Use a voice command lol

You could create a voice command with a phrase, "Disable shortcuts;Enable Shortcuts"

Inside that command, you could add a condition to check if the keyboard shortcuts are enabled, and if so, disable them - otherwise, if disabled, enable them.  You can also check if the command phrase used was "Disable" or "Enable", so that you don't toggle it when you wanted it off (or on) for example:




Ozias

  • Newbie
  • *
  • Posts: 6
Re: Stop keys registering
« Reply #2 on: October 09, 2023, 09:08:59 AM »
Hello and thanks for the great reply! I looked at this and determined that I have no idea how to input all those lines from begin text compare on down to say done. I only know how to input key/mouse inputs and pauses. I can't see how I can either type all that in there or input it in somehow. Also, is there no way to do this using a single keypress to toggle pausing registering of the keystrokes or must it be by voice only?  :)

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4781
  • RTFM
Re: Stop keys registering
« Reply #3 on: October 09, 2023, 09:23:57 AM »
While it is possible to use a hotkey to trigger a command, there is a logical issue with that in this context: if you disable hotkeys, you can't then trigger the command again using a normal hotkey to turn them back on again.


It can be done, but it'd require checking the key(s) in a loop, E.G.
Code: [Select]
Disable Hotkeys
Start Loop While :  Keyboard Key 'A' Is Pressed
End Loop
Start Loop While :  Keyboard Key 'A' Is Not Pressed
End Loop
Enable Hotkeys
The first loop waits from the key to be released, to prevent the keypress that triggered the command from immediately re-enabling hotkeys again.

One caveat is that the key cannot be prevented from passing through, so if possible you may want to choose a key (combination) that doesn't produce characters.


The "Loop Start" action can be added by clicking "Other >", "Advanced", "Add a Loop Start", "Single Condition (While Loop)"

You'd then use the "Device State" tab to choose a hotkey. For a key combination, you'd have to add each additional key using the condition builder.



Press F1 while VoiceAttack has focus to open VoiceAttackHelp.pdf in your default PDF viewer, which contains information on VoiceAttack's features.

These topics may also be of use, in addition to the official documentation:
Control flow (If, Else, ElseIf, Loop, Jump) basics
Variables and tokens summed up

SemlerPDX

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 291
  • Upstanding Lunatic
    • My AVCS Homepage
Re: Stop keys registering
« Reply #4 on: October 09, 2023, 01:18:26 PM »
Hello and thanks for the great reply! I looked at this and determined that I have no idea how to input all those lines from begin text compare on down to say done. I only know how to input key/mouse inputs and pauses. I can't see how I can either type all that in there or input it in somehow...

These are advanced actions and VoiceAttack actions which you can find under the "Other >" action list on the left.  Selecting an action adds it to the action list, just like adding a pause, etc.  Adding or Selecting that item (double-click) will open the options menu for that line (again, just like a pause action) where you can adjust settings.

The Begin Condition action is found under Other > Advanced menu as shown here:


The VoiceAttack action for Enable or Disable Shortcuts (keyboard) is found under the Other > VoiceAttack Actions menu:


When you add a Begin Condition, you can select the type of condition, and in this example we are using the Text tab along the top - this is where we can input the parameters of this condition, and chose the type of comparison to make:


In my first example in my previous reply, I showed the use of the {CMD} token to get what was said by the user to trigger this command.  These tokens are like keywords that hold a particular value we can use for all sorts of things, such as comparisons - in this case, the {CMD} token contains what was said to trigger this command, so it could either be "Enable Shortcuts", or "Disable shortcuts".  You can find out more about this and the rest of the tokens available in the VoiceAttack Help Manual around page 155 "Text (and Text-To-Speech) Tokens" - press F1 when VoiceAttack is in focus, and this guide will open in your default PDF viewer application:


It may seem like a lot at first, but once you start working with these conditions and loops and variables, you will find it easier and easier.  Read those posts linked by Pfeil above and you can get a great start on understanding logic and flow, and how to think in a step-by-step manner that you can translate into lists of actions inside voice commands.

Best wishes and good luck to you!!

Ozias

  • Newbie
  • *
  • Posts: 6
Re: Stop keys registering
« Reply #5 on: October 10, 2023, 09:13:38 AM »
With these last 2 posts together I was able to fix this issue! Thank you guys so much and I hope many others that had this problem will now have the solution too. I will continue to tell every gamer I meet to get this great program!!  :)