Author Topic: Device Check  (Read 693 times)

Rabe

  • Newbie
  • *
  • Posts: 13
Device Check
« on: July 05, 2024, 02:02:04 PM »
Is there a command that will allow me to do what Device Check does but using the state of the togglable keys such as CAPS, NUM, etc.?

To cover the background information, Device Check lets you add a logic branch based on if a key is being pressed or not.  And I want to do the same thing based on if I have NUM or CAP or any other togglable key in a specific state.

SemlerPDX

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 292
  • Upstanding Lunatic
    • My AVCS Homepage
Re: Device Check
« Reply #1 on: July 05, 2024, 10:35:33 PM »
Yes - you can use the following tokens to determine the state of Caps Lock, Scroll Lock, or Num Lock respectively:

Code: [Select]
{CAPSLOCKON}
Code: [Select]
{NUMLOCKON}
Code: [Select]
{SCROLLLOCKON}
...see the VoiceAttack Manual around page 171 (press F1 when VA is in focus):

Rabe

  • Newbie
  • *
  • Posts: 13
Re: Device Check
« Reply #2 on: July 05, 2024, 11:06:54 PM »
Thanks, and maybe I am just tired, but I can't seem to get it to work.

"Begin Device State Check: Keyboard Key 'Backspace' Is Pressed" will work

but "Begin Boolean Compare: [SCROLLLOCKON] Equals True" will not.

Nor does ScrollLockOn() or {SCROLLLOCKON}.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4792
  • RTFM
Re: Device Check
« Reply #3 on: July 06, 2024, 09:09:24 AM »
Tokens are always text. You're using the wrong tab of the condition action.

SemlerPDX

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 292
  • Upstanding Lunatic
    • My AVCS Homepage
Re: Device Check
« Reply #4 on: July 06, 2024, 02:26:14 PM »
...
but "Begin Boolean Compare: [SCROLLLOCKON] Equals True" will not.
...

As Pfeil pointed out, the return is text.  You use Text Compare and not Boolean Compare. The token must be written as shown, surrounded with curly brackets.

Code: [Select]
{SCROLLLOCKON}
Just like it says in the manual (which I took a screenshot of), the return will be a "1" (in text) or "0", depending on the state, and not "true" or "false" like a boolean:




Rabe

  • Newbie
  • *
  • Posts: 13
Re: Device Check
« Reply #5 on: July 11, 2024, 12:47:22 PM »
Thank you.  I considered many things but didn't intuitively realize that the binary choice of 0 vs. 1 wasn't Boolean, and wasn't integer either, but was text instead.  I tried both but never thought to test the text option.  But it works, so I'm happy.  Now, when future me tries to modify I may confuse myself but hopefully I'll read my reply and be reminded.