Author Topic: Shortcuts Off and Shortcuts On  (Read 2501 times)

Jeremy99

  • Guest
Shortcuts Off and Shortcuts On
« on: May 04, 2019, 09:45:12 AM »
Hello,

I seem to have run into a problem, perhaps something i'm not doing correctly.

I want to have a hotkey that toggles keyboard Shortcuts on/off

I tried to map the commands, but as expected when I run the command to disable shortcuts, VoiceAttack will not recognise anything I press to re enable it.

For example, if I would like CTRL S  to be toggle key ?

Is there a way to do this for keyboard shortcuts ?



Thanks for your time.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Shortcuts Off and Shortcuts On
« Reply #1 on: May 04, 2019, 09:56:37 AM »
Hi, Jeremy

Turning off keyboard shortcuts in VA is for turning off keyboard hooks entirely.  So, if you turn the shortcuts off, you're turning off VA's ability to capture keyboard events.  This is by design to provide a way for VA to completely not interfere with other applications.

Jeremy99

  • Guest
Re: Shortcuts Off and Shortcuts On
« Reply #2 on: May 04, 2019, 10:10:57 AM »
Hi

Thanks for the reply, but wouldn't something like this work, I just don't know the keystate name is for CTRL-S

;CTRL-S -executes the macro below;


Stop VoiceAttack listening
Disable Hotkeys
Start Loop While : [{STATE_KEYSTATE:LCTRL+S}] Equals '0'
End Loop
Start VoiceAttack listening
Enable Hotkeys



Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Shortcuts Off and Shortcuts On
« Reply #3 on: May 04, 2019, 11:04:44 AM »
That's a great attempt to get that to work.  However, the key state token only works with one key at a time, and, token processing is a little bit heavier than this:

Code: [Select]
Start Loop While : [myVar] Equals False
    Begin Condition : (Keyboard Key 'Ctrl' Is Pressed AND Keyboard Key 'S' Is Pressed)
        Write [Blue] 'done' to log
        Loop Break
    End Condition
End Loop

I've attached an exported profile with this command so you can take a look at it.

Jeremy99

  • Guest
Re: Shortcuts Off and Shortcuts On
« Reply #4 on: May 11, 2019, 07:21:09 AM »
Thank you for the help Gary, Much Appreciated

I've got it all working now