KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: Problem with Sending Combination keys
Topic Summary:
Created On: 05/20/2022 07:53 AM
Status: Post and Reply
Linear : Threading : Single : Branch
 Problem with Sending Combination keys   - Fmen - 05/20/2022 07:53 AM  
 Problem with Sending Combination keys   - Alan Cantor - 05/20/2022 09:34 AM  
 Problem with Sending Combination keys   - Fmen - 05/20/2022 10:30 AM  
 Problem with Sending Combination keys   - Matt_Chambers - 05/20/2022 11:00 AM  
 Problem with Sending Combination keys   - Fmen - 05/20/2022 11:09 AM  
 Problem with Sending Combination keys   - Alan Cantor - 05/20/2022 11:22 AM  
 Problem with Sending Combination keys   - dilligence - 05/20/2022 11:31 AM  
 Problem with Sending Combination keys   - Fmen - 05/20/2022 12:49 PM  
 Problem with Sending Combination keys   - Fmen - 05/20/2022 12:48 PM  
 Problem with Sending Combination keys   - ax - 05/20/2022 01:37 PM  
 Problem with Sending Combination keys   - dilligence - 05/20/2022 02:11 PM  
 Problem with Sending Combination keys   - Fmen - 05/22/2022 03:35 PM  
 Problem with Sending Combination keys   - Alan Cantor - 05/21/2022 11:36 AM  
 Problem with Sending Combination keys   - Fmen - 05/22/2022 03:39 PM  
 Problem with Sending Combination keys   - dilligence - 05/22/2022 09:33 PM  
 Problem with Sending Combination keys   - PG LTU - 05/23/2022 07:02 PM  
 Problem with Sending Combination keys   - Fmen - 05/24/2022 08:12 AM  
 Problem with Sending Combination keys   - Matt_Chambers - 05/24/2022 08:30 AM  
 Problem with Sending Combination keys   - Fmen - 05/24/2022 11:48 AM  
 Problem with Sending Combination keys   - monkey8 - 05/24/2022 01:43 PM  
 Problem with Sending Combination keys   - Fmen - 05/24/2022 10:43 AM  
 Problem with Sending Combination keys   - Lunis Orcutt - 05/24/2022 02:02 PM  
 Problem with Sending Combination keys   - ax - 05/24/2022 08:15 PM  
 Problem with Sending Combination keys   - Fmen - 05/25/2022 01:02 PM  
 Problem with Sending Combination keys   - Fmen - 05/27/2022 03:46 PM  
 Problem with Sending Combination keys   - WilliamConnor - 05/31/2022 08:19 AM  
Keyword
 05/20/2022 07:53 AM
User is offline View Users Profile Print this message

Author Icon
Fmen
Senior Member

Posts: 110
Joined: 08/17/2015

I've just started using Naturally Speaking 15 as a long time user of Medical Dragon and for some reason cannot get SendKeys to send the combination modifier keys to trigger hotkeys from autoit. I had no similar issues using Medical Dragon.

Step-by-step works fine  eg Press Key SHIFT+ALT+CTRL+i

Advanced Scripting is a no go for comple combination keys:

SendKeys"+^%1"

SendSystemKeys"{Ctrl+Shift+Alt}i"

Simple key combinations like ^f, %{F1} are OK.

I am on Windows 10 

What am I missing?

Thanks

 

Also, my User-defined folder has gone missing in Command Browser and I can't get it back.

 

 

 

 

 

 05/20/2022 09:34 AM
User is offline View Users Profile Print this message


Alan Cantor
Top-Tier Member

Posts: 4313
Joined: 12/08/2007

I think this should work:

SendSystemKeys "{Ctrl+Shift+Alt+i}"
 05/20/2022 10:30 AM
User is offline View Users Profile Print this message

Author Icon
Fmen
Senior Member

Posts: 110
Joined: 08/17/2015

Thanks Alan, I tried that and other combinations without success. Since it is a new installation, is there maybe something I need to turn on or off in the settings/options area?
 05/20/2022 11:00 AM
User is offline View Users Profile Print this message

Author Icon
Matt_Chambers
Top-Tier Member

Posts: 569
Joined: 08/09/2018

On your SendKeys version, do you have a space between SendKeys and the open quotation mark? In your first post, you do not, which is why I ask.

Should be SendKeys "^+%i". I have no idea why that would not work.
 05/20/2022 11:09 AM
User is offline View Users Profile Print this message

Author Icon
Fmen
Senior Member

Posts: 110
Joined: 08/17/2015

Matt, I am assuming you mean the space between Sendkeys and first quotation mark, but no a space is not required. However even with a space, SendKeys "^+%i", there is no response.
 05/20/2022 11:22 AM
User is offline View Users Profile Print this message


Alan Cantor
Top-Tier Member

Posts: 4313
Joined: 12/08/2007

Is your Dragon script application- or window-specific? If window-specific, perhaps the title needs to be updated.
 05/20/2022 11:31 AM
User is offline View Users Profile Print this message

Author Icon
dilligence
Top-Tier Member

Posts: 1526
Joined: 08/16/2010

Are you talking about an app made with AutoIt (which possibly might need to be activated first) or is it a global AutoIt hook?

 

If I understand correctly Dragon step-by-step commands do work on your system? 

 

I've run into this issue several times before and found that (contrary to popular beliefs) Dragon step-by-step commands sometimes work where scripting doesn't. Maybe it emulates "real" user keyboard input more closely than Advanced Scripting?



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

https://speechproductivity.eu


Turbocharge your Dragon® productivity with 40 Power Addons

 05/20/2022 12:49 PM
User is offline View Users Profile Print this message

Author Icon
Fmen
Senior Member

Posts: 110
Joined: 08/17/2015

Originally posted by: dilligence Are you talking about an app made with AutoIt (which possibly might need to be activated first) or is it a global AutoIt hook?

If I understand correctly Dragon step-by-step commands do work on your system? 

I've run into this issue several times before and found that (contrary to popular beliefs) Dragon step-by-step commands sometimes work where scripting doesn't. Maybe it emulates "real" user keyboard input more closely than Advanced Scripting?

 

I have an AutoIt script with a series of hotkeys that I want to trigger with voice commands. The step-by-step commands work perfectly without needing anything from AutoIt, the advanced scripting SendKeys, does not. 

Is there a fix?



 05/20/2022 12:48 PM
User is offline View Users Profile Print this message

Author Icon
Fmen
Senior Member

Posts: 110
Joined: 08/17/2015

Nah, the script is global. 

This is really weird. It will work for things like ^a or ^c but not for ^{esc} or +^{esc}. Even simple combinations will not trigger any of my hotkeys from AutoIt.

 05/20/2022 01:37 PM
User is offline View Users Profile Print this message

Author Icon
ax
Top-Tier Member

Posts: 397
Joined: 03/22/2012

^^^ Purely speculating on my end: dilligence is quite likely onto something.  It is possible that the problem isn't your Dragon at all.  But with AutoIt.

Caveat: I neither use Desktop Dragon nor AutoIt.  However, AutoIt supposedly shares some DNA with AutoHotKey, which is something I presently can't live without.

https://www.autohotkey.com/docs/commands/SendLevel.htm (under General Remarks)

Basically in order to avoid "infinite hotkey activation loop", it is possible, or even plausible that AutoIt has built-in safe guard to prevent "self-activation" of hotkeys.  Since the newer Desktop Dragon seems to employ similar underlying, fast/reliable mechanism of sending keys, it could be tripping off AutoIt/AutoHotkey's hotkey self-activation protective mechanism.

Whereas keyboard emulation ala DMO or VoiceMacro (what I use daily) don't run into this problem.  "Emulation of typing" (as I loosely understand) is slow and overall not as reliable (but conversely might sport the advantage of not setting off any "tripwire").

Possibly you may have to do one of the following:

1. Figure out what the "typing emulation" equivalent method of sending keys is in Desktop Dragon.  Could be along the line of "typing something" ... "pausing 100 ms" ... "typing another key".  Would Knowbrainer let you do that?  I wouldn't know.

2. Tinker with the equivalent of SendLevel / #InputLevel in AuoIt - if AutoIt has similar implements.  They work in AutoHotKey, although can be confusing to use (from my own limited personal experience).

3. Bypass the hotkey(s) altogether and use the well-published ShellExecute routine (all over this forum) to directly call out your AutoIt command (as a "runnable" file or standalone executable) from Desktop Dragon to do what the hotkey is supposed to do - without invoking the hotkey at all.

 

If I was out to lunch, please just ignore the whole comment.  After all, I reiterate that I currently use neither Desktop Dragon nor AutoIt myself.

 



 05/20/2022 02:11 PM
User is offline View Users Profile Print this message

Author Icon
dilligence
Top-Tier Member

Posts: 1526
Joined: 08/16/2010

Just out of curiosity. Try to run the below VBScript. Copy the code to Notepad and save it with the extension .vbs

 

set WshShell = WScript.CreateObject("WScript.Shell")

          WshShell.SendKeys "^+%i"

 

Click on the file. Does it trigger your AutoIt script?

 

If so, instead of manually clicking the VBS call it via a (preferably DVC) Dragon® script using AppBringUp.

 

Does it work?



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

https://speechproductivity.eu


Turbocharge your Dragon® productivity with 40 Power Addons

 05/22/2022 03:35 PM
User is offline View Users Profile Print this message

Author Icon
Fmen
Senior Member

Posts: 110
Joined: 08/17/2015

Originally posted by: dilligence Just out of curiosity. Try to run the below VBScript. Copy the code to Notepad and save it with the extension .vbs

 

 

 

set WshShell = WScript.CreateObject("WScript.Shell")

 

          WshShell.SendKeys "^+%i"

 

 

 

Click on the file. Does it trigger your AutoIt script?

 

 

 

If so, instead of manually clicking the VBS call it via a (preferably DVC) Dragon® script using AppBringUp.

 

 

 

Does it work?

 

 

I get an error for line one...not an object reference

 05/21/2022 11:36 AM
User is offline View Users Profile Print this message


Alan Cantor
Top-Tier Member

Posts: 4313
Joined: 12/08/2007


It will work for things like ^a or ^c but not for ^{esc} or +^{esc}


Perhaps Ctrl + Esc and Shift + Ctrl + Esc are reserved by Windows. The former has been the alternative way to access the Start menu since Windows 95. The latter is the hotkey to invoke the Task Manager.
 05/22/2022 03:39 PM
User is offline View Users Profile Print this message

Author Icon
Fmen
Senior Member

Posts: 110
Joined: 08/17/2015

Originally posted by: Alan Cantor
It will work for things like ^a or ^c but not for ^{esc} or +^{esc}
Perhaps Ctrl + Esc and Shift + Ctrl + Esc are reserved by Windows. The former has been the alternative way to access the Start menu since Windows 95. The latter is the hotkey to invoke the Task Manager.

 

Yes, the examples were not meant for hotkeys but to open Task Manager or the Start menu, neither of which occurs.

 

I may try re-installing everything ...

 05/22/2022 09:33 PM
User is offline View Users Profile Print this message

Author Icon
dilligence
Top-Tier Member

Posts: 1526
Joined: 08/16/2010

It is strange that the VBScript I posted earlier gives a scripting error on your system. Must've something to do with Auto Hotkey. I will check that out when I have some more time.

 

Does this one, for opening up Task Manager work on your system?

Works perfectly on mine (also when run via a AppBringUp command):

 

set WshShell = WScript.CreateObject("WScript.Shell")

          WshShell.SendKeys "^+{Esc}"



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

https://speechproductivity.eu


Turbocharge your Dragon® productivity with 40 Power Addons

 05/23/2022 07:02 PM
User is offline View Users Profile Print this message

Author Icon
PG LTU
Top-Tier Member

Posts: 2202
Joined: 03/21/2007

Saying "press control shift escape" opens the Task Manager, right? So:

   '#Language "WWB-COM"

   Option Explicit

   Sub Main
      EngineControl.RecognitionMimic("press control shift escape")
   End Sub


But honestly why would you use a voice command to press a hotkey to run a command? Can't you just run that command with the voice command directly? AutoIT (perhaps) and AHK (for sure) allow multiple labels so you can run subroutines by a label and add a hotkey label. VoiceMacro has yet even more useful triggers available (timing, events, etc.).

Enjoy,



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




PG





Remember folks, my comments and this forum are for entertainment value only, please, no wagering or other reliance on the contents herein.  I permit no commercial use of my ideas (whether expressions or embodiments) without my written consent.



 05/24/2022 08:12 AM
User is offline View Users Profile Print this message

Author Icon
Fmen
Senior Member

Posts: 110
Joined: 08/17/2015

I want to thank everyone for their input.
I tried using DVC and SendSystemKeys complex key combinations work fine.
I tried re-installing Dragon but Advanced Scripting still does not pick up complex system key combinations.
@PG I am much more adept at writing complex Autoit commands than I am with Dragon scripting. I need to look more closely at your excellent "run subroutine by label", it looks to be incredibly useful! For now I think I will go back to VoiceMacro. I'd tried it in the past but had poor voice recognition. Tried it again and it seems to be much better now.
Thanks again everyone.
 05/24/2022 08:30 AM
User is offline View Users Profile Print this message

Author Icon
Matt_Chambers
Top-Tier Member

Posts: 569
Joined: 08/09/2018

Originally posted by: Fmen I want to thank everyone for their input. I tried using DVC and SendSystemKeys complex key combinations work fine. I tried re-installing Dragon but Advanced Scripting still does not pick up complex system key combinations. @PG I am much more adept at writing complex Autoit commands than I am with Dragon scripting. I need to look more closely at your excellent "run subroutine by label", it looks to be incredibly useful! For now I think I will go back to VoiceMacro. I'd tried it in the past but had poor voice recognition. Tried it again and it seems to be much better now. Thanks again everyone.

Are you using DPI 15.61 or an earlier version, such as 15.3?  I have found that SendKeys is much more reliable in 15.61, probably because Dragon switched to Winwrap Basic.  

 05/24/2022 11:48 AM
User is offline View Users Profile Print this message

Author Icon
Fmen
Senior Member

Posts: 110
Joined: 08/17/2015

It is version 15.3.

 05/24/2022 01:43 PM
User is offline View Users Profile Print this message

Author Icon
monkey8
Top-Tier Member

Posts: 3904
Joined: 01/14/2008

Originally posted by: Fmen It is version 15.3.

 

 

 

Possibly the reason it is not working with Advanced Scripting is because you are using DPI 15.3 which uses a very old scripting engine called SAX Basic which in turn uses Windows Journal playback hook (WH_JOURNALPLAYBACK) to "implement "SendKeys". If you update to 15.61, which is free, as suggested by Matt you will then be using a much newer scripting engine called WinWrap basic which implements "SendKeys" using the Windows API function SendInput.

 

Then the following syntax should work: SendKeys"^+%i" in Advanced Scripting.



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



 05/24/2022 10:43 AM
User is offline View Users Profile Print this message

Author Icon
Fmen
Senior Member

Posts: 110
Joined: 08/17/2015

I want to thank everyone for their input.
I tried using DVC and SendSystemKeys complex key combinations work fine.
I tried re-installing Dragon but Advanced Scripting still does not pick up complex system key combinations.
@PG I am much more adept at writing complex Autoit commands than I am with Dragon scripting. I need to look more closely at your excellent "run subroutine by label", it looks to be incredibly useful! For now I think I will go back to VoiceMacro. I'd tried it in the past but had poor voice recognition. Tried it again and it seems to be much better now.
Thanks again everyone.
 05/24/2022 02:02 PM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 39833
Joined: 10/01/2006

Note that Ver. 15.3 uses the sluggish dated circa 2004 SAX Basic scripting engine. You will need to upgrade to Ver. 15.61 in order to take advantage of the WinWrap Basic scripting engine, which we also use in KnowBrainer. We recommend starting there



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

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



 05/24/2022 08:15 PM
User is offline View Users Profile Print this message

Author Icon
ax
Top-Tier Member

Posts: 397
Joined: 03/22/2012


Originally posted by: monkey8
... DPI 15.3 which uses a very old scripting engine called SAX Basic which in turn uses Windows Journal playback hook (WH_JOURNALPLAYBACK) to "implement "SendKeys".

 

According to AHK documentation, the kind of hotkeys that can't be "programmably" activated by another AHK script (at the same "SendLevel") are precisely the ones implemented through keyboard "hook".  Not sure if it jibes with above detail, or applicable with AutoIt.

 


Originally posted by: PG LTU ... AutoIT (perhaps) and AHK (for sure) allow multiple labels so you can run subroutines by a label and add a hotkey label.

 

Thanks PG for sharing above tip.  As my 9-yo daughter has been fond of saying (to me) lately: "d@mn son" ... indeed it's another trick that may come handy to me, too.  Will need to digest it a bit.



Originally posted by: Fmen ... For now I think I will go back to VoiceMacro. I'd tried it in the past but had poor voice recognition. Tried it again and it seems to be much better now. Thanks again everyone.

 

In my experience, deployed as a command-only tool, VoiceMacro is satisfyingly accurate if I set the "Dictionary weight" to 0% - even at 1% accuracy is palpably worse.  Recognition threshold has more room for tweaking and seemingly less of an effect (mine is set at 85%). 

 

Setting "Dictionary weight" to 0% has some side-effects.  But during my "production use" for over a year, the side-effects are incredibly minor, and nothing that can't be fixed by resetting the Windows Speech Recognition Profile after a few months.  At initial use and post-resetting, a 5-to-10-min training of the Microsoft Recognizer (built into Windows 10) is recommended, unlike Dragon which hardly needs any training these days.  

I leave VoieMacro "always-on" and for my cloud Dragon, I use push-to-talk.  AutoHotKey scripting allows me to "suppress" VoiceMacro while pushing-to-talk in Dragon, so as to avoid unintended command activation.

 

Case-in-point: one of my most relied-upon VoiceMacro commands is called "2 C".  Two syllables - no more, no less.  It is simply "double-click".  

I use that whenever my finger gets tired.  I think it is doing an admirable job in RSI prevention.

When I am too tired to even sit up straight, I find that I can still pronounce "2 C" quite "effortlessly" (probably the hypoglossal nerve and tonue muscles get worn down a bit more quickly than the facial muscle and nerves).  Yes there is a corresponding "1 C", which I use far less.   Good luck with using Dragon to reliably and painlessly implement such 2-syllable commands.

As I was jesting in the other thread, Javelin is not a replacement for the M109.  But neither is a 30-ton howitzer replacement for the agile Javelin.  I am starting to think the likes of VoiceMacro and some flavour of Dragon are "complementary".



 05/25/2022 01:02 PM
User is offline View Users Profile Print this message

Author Icon
Fmen
Senior Member

Posts: 110
Joined: 08/17/2015

Thanks for the VoiceMacro hints, ax. I am going to change the settings as suggested and hope for even better recognition. I fully agree that a fly swatter is more appropriate than an elephant gun if you are trying to swat a fly.

 

 05/27/2022 03:46 PM
User is offline View Users Profile Print this message

Author Icon
Fmen
Senior Member

Posts: 110
Joined: 08/17/2015

Updated to 15.61 and problem was fixed. I am so glad this forum exists. It has helped me out innumerable times.
 05/31/2022 08:19 AM
User is offline View Users Profile Print this message

Author Icon
WilliamConnor
New Member

Posts: 1
Joined: 05/31/2022

Thanks for the suggestions. I was searching for the business consultants services online and while searching for it online, I found your post.



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

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