KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: List variables that are keys to be pressed
Topic Summary:
Created On: 06/03/2022 04:50 PM
Status: Post and Reply
Linear : Threading : Single : Branch
 List variables that are keys to be pressed   - mareid - 06/03/2022 04:50 PM  
 List variables that are keys to be pressed   - noblemd - 06/03/2022 05:55 PM  
 List variables that are keys to be pressed   - Matt_Chambers - 06/03/2022 05:56 PM  
 List variables that are keys to be pressed   - Lunis Orcutt - 06/03/2022 07:34 PM  
 List variables that are keys to be pressed   - mareid - 06/04/2022 09:25 AM  
 List variables that are keys to be pressed   - Lunis Orcutt - 06/04/2022 06:42 PM  
Keyword
 06/03/2022 04:50 PM
User is offline View Users Profile Print this message

Author Icon
mareid
Power Member

Posts: 59
Joined: 01/25/2019

Hello! I'm very new to whatever this scripting language is that Dragon uses (VBA?). I've written some simple commands, but I can't figure out how to make any command where a key to be pressed is passed as a spoken argument. For example, let's say I wanted to make a command to press an arrow key. I realize there are existing commands to do this kind of thing, I'm just using this as an example of trying to pass the name of the key to be pressed as an argument. The command would be something like:

Command Name: Nudge <direction>

where the argument would be a list of directions (up, down, left, right). I can't figure out how to pass that argument as a keypress. For example, the following doesn't work:

Sub Main

      SendKeys ListVar1

End Sub

 

I assume there's some kind of formatting for "ListVar1" that I'm missing, but Google isn't helping me. Could anyone kindly explain?



 06/03/2022 05:55 PM
User is offline View Users Profile Print this message

Author Icon
noblemd
Junior Member

Posts: 40
Joined: 08/09/2019

As far as "whatever this scripting language is that Dragon uses" see WinWrap® Basic Documentation

'#Language "WWB-COM" = WinWrap® Basic

https://www.winwrap.com/web2/basic/#!/ref/WWB-doc_language_def.htm

As far as ListVar1 - see https://www.nuance.com/products/help/dragon/dragon-for-pc/scriptref/Content/scrptref/sendkeys.htm?Highlight=ListVar1

and other similar documentation.

Creating custom commands in Dragon NaturallySpeaking. Expanding editing and navigation possibilities.  Episode 2. | Speech Recognition Valley (wordpress.com)



-------------------------

Michael Noble
-------------------------
Using $20 USB Mic on adjustable arm ($30 total cost - 99.9% recognition). 


 


DPI 15.61.200.010 - Windows 11 Pro for Workstations Latest Update / MS Office 2021 LTSC



 06/03/2022 05:56 PM
User is offline View Users Profile Print this message

Author Icon
Matt_Chambers
Top-Tier Member

Posts: 582
Joined: 08/09/2018

Try SendKeys "{"+ ListVar1 +"}"

Dragon uses Winwrap Basic. You might want to buy and read Larry Allen's book on Advanced Scripting. Or just look at examples posted here.

Edit: Michael Noble beat me to it.  I agree with everything he wrote.



 06/03/2022 07:34 PM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 39967
Joined: 10/01/2006

You can copy the following KnowBrainer 2020 command which is called <direction> <1to100>. KnowBrainer and Dragon use WinWrap Basic so you can copy this KnowBrainer script into Dragon as an Advanced-Scripting command but you will also have to define both lists.... Or you can optionally purchase KnowBrainer 2020 which does so much more

 

Sub Main
If ListVar1 = "Previous" Then SendKeys "{Left "+ListVar2+"}"
If ListVar1 = "Next" Then SendKeys "{Right "+ListVar2+"}"
If ListVar1 = "Tab" Then SendKeys "{Tab "+ListVar2+"}"
If ListVar1 = "Shift Tab" Then SendKeys "+{Tab "+ListVar2+"}"
If ListVar1 = "Back Tab" Then SendKeys "+{Tab "+ListVar2+"}"
If ListVar1 = "Left" Then SendKeys "{Left "+ListVar2+"}"
If ListVar1 = "Right" Then SendKeys "{Right "+ListVar2+"}"
If ListVar1 = "Down" Then SendKeys "{Down "+ListVar2+"}"
If ListVar1 = "Up" Then SendKeys "{Up "+ListVar2+"}"
If ListVar1 = "Space" Then SendKeys "{Space "+ListVar2+"}"
If ListVar1 = "Spacebar" Then SendKeys "{Space "+ListVar2+"}"
If ListVar1 = "Backspace" Then SendKeys "{Backspace "+ListVar2+"}"
If ListVar1 = "Enter" Then SendKeys "{Enter "+ListVar2+"}"
If ListVar1 = "Shift Enter" Then SendKeys "+{Enter "+ListVar2+"}"
If ListVar1 = "Shift Left" Then SendKeys "+{Left "+ListVar2+"}"
If ListVar1 = "Shift Right" Then SendKeys "+{Right "+ListVar2+"}"
If ListVar1 = "Shift Up" Then SendKeys "+{Up "+ListVar2+"}"
If ListVar1 = "Shift Down" Then SendKeys "+{Down "+ListVar2+"}"
End Sub


-------------------------

Change "No" to "Know" w/KnowBrainer 2020
Trial Downloads
Dragon/Sales@KnowBrainer.com 
(615) 884-4558 ex 1

 06/04/2022 09:25 AM
User is offline View Users Profile Print this message

Author Icon
mareid
Power Member

Posts: 59
Joined: 01/25/2019

Thanks so much for all your help, everyone! I had been combing through Nuance's documentation, but it's so scanty with so few examples that I found it hard to use. I will definitely look into that book about Winwrap Basic. And thanks, Lunis, for the detailed example!
 06/04/2022 06:42 PM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 39967
Joined: 10/01/2006

You might also consider Larry Allen's Scripting for Dragon



-------------------------

Change "No" to "Know" w/KnowBrainer 2020
Trial Downloads
Dragon/Sales@KnowBrainer.com 
(615) 884-4558 ex 1

Statistics
32324 users are registered to the KnowBrainer Speech Recognition forum.
There are currently 0 users logged in.
The most users ever online was 12124 on 09/09/2020 at 04:59 AM.
There are currently 365 guests browsing this forum, which makes a total of 365 users using this forum.

FuseTalk Standard Edition v4.0 - © 1999-2022 FuseTalk™ Inc. All rights reserved.