![]() |
KnowBrainer Speech Recognition | ![]() |
Topic Title: In DNS Advanced Scripting, how do I send the Windows key? Topic Summary: Created On: 09/09/2020 06:01 PM Status: Post and Reply |
|
![]() |
![]() |
- wristofdoom | - 09/09/2020 06:01 PM |
![]() |
![]() |
- dilligence | - 09/09/2020 06:34 PM |
![]() |
![]() |
- Lunis Orcutt | - 09/09/2020 06:47 PM |
![]() |
![]() |
- wristofdoom | - 09/10/2020 10:41 AM |
![]() |
![]() |
- wristofdoom | - 09/10/2020 12:33 PM |
![]() |
![]() |
- wristofdoom | - 09/12/2020 09:05 PM |
![]() |
![]() |
- dilligence | - 09/12/2020 09:16 PM |
![]() |
![]() |
- wristofdoom | - 09/12/2020 09:47 PM |
![]() |
![]() |
- MDH | - 09/12/2020 09:55 PM |
![]() |
![]() |
- Lunis Orcutt | - 09/12/2020 10:41 PM |
![]() |
![]() |
- Matt_Chambers | - 09/13/2020 07:53 AM |
![]() |
![]() |
- IceRafter | - 11/16/2021 08:50 AM |
![]() |
![]() |
- Matt_Chambers | - 11/16/2021 11:09 AM |
![]() |
![]() |
- Lunis Orcutt | - 11/16/2021 12:45 PM |
![]() |
![]() |
- jmcvay | - 11/20/2021 03:57 PM |
![]() |
![]() |
- Matt_Chambers | - 11/20/2021 04:27 PM |
![]() |
![]() |
- Lunis Orcutt | - 11/21/2021 04:08 PM |
![]() |
![]() |
- Matt_Chambers | - 11/21/2021 04:13 PM |
![]() |
![]() |
- jmcvay | - 11/22/2021 11:26 AM |
![]() |
![]() |
- kkkwj | - 11/20/2021 04:22 PM |
![]() |
![]() |
- Lunis Orcutt | - 11/21/2021 07:33 PM |
![]() |
![]() |
- Matt_Chambers | - 11/22/2021 07:02 AM |
![]() |
![]() |
- monkey8 | - 12/04/2021 07:08 AM |
![]() |
![]() |
- kkkwj | - 12/05/2021 05:43 PM |
![]() |
![]() |
- monkey8 | - 12/08/2021 10:51 AM |
![]() |
![]() |
- wristofdoom | - 02/19/2022 06:09 PM |
![]() |
![]() |
- Alan Cantor | - 02/19/2022 07:53 PM |
![]() |
|
I want to write a script that involves pressing the Windows key. I want to do it in DNS, not Knowbrainer.
I started writing a script called "open Knowbrainer". I want the script to hit the Windows key, wait, then send the text "Knowbrainer professional 2017", wait, and then hit enter.
But I can't figure out how to send the Windows key.
I tried "SendKeys "{Windows}"", "SendKeys "{Win}"", and "SendKeys "^{Esc}"" but none of them work.
I would have thought this would be a common need, but I am having an amazingly hard time finding a clear answer about how to do this. The list of keys on the Nuance website do not include the Windows key.
Thanks ------------------------- Dragon Professional Individual v15.6. Windows 10. Knowbrainer 2017. |
|
|
|
![]() |
|
It's very easy to do with a DVC command (double-click an existing one in your Dragon Command Browser and then click Create New button):
SendSystemKeys "{win}" Wait 500 SendKeys "Knowbrainer professional 2017" Wait 200 SendSystemKeys "{Enter}" ------------------------- Turbocharge your Dragon productivity with 40+ Power Addons |
|
|
|
![]() |
|
Just a very tiny recommendation. If you add the “S” it will work on all systems. The other option will not work in some situations. SendSystemKeys "{win+s}" Wait 500 SendKeys "Knowbrainer professional 2017" Wait 200 SendSystemKeys "{Enter}" ------------------------- Change "No" to "Know" w/KnowBrainer 2022 |
|
|
|
![]() |
|
Thanks. Can you be more detailed in how to create a DVC script instead of Advanced Scripting? I go to my Command Browser, and I don't see any commands with this type. I create a new command, and I do not see "DVC" as an option for command type. My only type of commands are step-by-step, macro, Advanced Scripting, and general text.
------------------------- Dragon Professional Individual v15.6. Windows 10. Knowbrainer 2017. |
|
|
|
![]() |
|
Okay, nevermind, now I see what you mean.
I need to modify one of the default "mouse click" type of commands that are built into Dragon.
Thanks! ------------------------- Dragon Professional Individual v15.6. Windows 10. Knowbrainer 2017. |
|
|
|
![]() |
|
Follow-up question on this... Do you always need to use "SendSystemKeys" (rather than SendKeys or SendDragonKeys) when you are trying to press the Windows key? Or is there a way to send the Windows key without resorting to the slower SendSystemKeys command?
------------------------- Dragon Professional Individual v15.6. Windows 10. Knowbrainer 2017. |
|
|
|
![]() |
|
SendSystemKeys is usually more reliable when it comes to using the Windows key as modifier key. Another example of using it would be to access the notification area:
SendSystemKeys "{win+b}"
There is no real noticeable speed difference when the script is only one line. The rule of thumb is to first try regular SendKeys and if that don't work use SendSystemKeys. ------------------------- Turbocharge your Dragon productivity with 40+ Power Addons |
|
|
|
![]() |
|
Got it, thank you.
Under what circumstances would I want to use SendDragonKeys rather than SendKeys or SendSystemKeys? ------------------------- Dragon Professional Individual v15.6. Windows 10. Knowbrainer 2017. |
|
|
|
![]() |
|
"Under what circumstances would I want to use SendDragonKeys rather than SendKeys or SendSystemKeys?"
Use SendDragonKeys preferentially using Citrix.
MDH ------------------------- |
|
|
|
![]() |
|
With the release of the DPI 15.6 Download we suspect that SendDragonKeys will no longer hold an advantage over SendKeys but we're also not in a position to test this unproven theory. ------------------------- Change "No" to "Know" w/KnowBrainer 2022 |
|
|
|
![]() |
|
My impression is that SendKeys is now much faster than SendDragonKeys. I did a speed test using a variant of the command that Alan Cantor recommended a few months ago and this is what I got: |
|
|
|
![]() |
|
in response to the question under what circumstances to use SendDragonKeys over SendKeys, I generally always use SendDragonKeys due to the consistent XML-tag syntax, e.g.{Ctrl+s} instead of ^s, {Alt+e} instead of %e, {Shift+z} instead of +z, etc. Find it preferable for spitting out equations and formula strings actually containing ^+% characters.
Besides being slower than grinding rocks into dirt, a very subtle difference between SendSystemKeys and two alternatives is that it RESPECTS THE STATE OF THE CAPS-LOCK KEY, which CAN be problematic if your target application is case-sensitive. Swear that at some point in the not-too-distant past, SendDragonKeys also respected the state of the caps lock key, but such is not the case today. Verified as much with 15.611.200.010 Dragon build.
Caps lock off Test
SendKeys: this should be all lowercase
Caps lock on Test
SendKeys: this should be all lowercase ------------------------- Ice Rafter |
|
|
|
![]() |
|
Unless Nuance changed the code with the 15.6 release, the output of the SendKeys statement respects the state of the caps lock key, inverting the expected output case-wise if caps lock is active.
I just used a SendKeys instruction with the caps lock, and the text came out in lowercase, as the command instructed. I'm using DPI 15.61. Nuance seemed to improve SendKeys somehow with 15.61. In my experience, SendKeys instructions are now quicker to execute than SendDragonKeys or SendSystemKeys, and nearly as quick as DVC commands. |
|
|
|
![]() |
|
You are quite right. Nuance finally retired the ancient SAX scripting engine (used in Ver. 15.3) for WinWrap Basic (used in Ver. 15.61), which is what we utilize in KnowBrainer 2020. ------------------------- Change "No" to "Know" w/KnowBrainer 2022 |
|
|
|
![]() |
|
Interesting discussion about Sendkeys, SendSystemKeys, and SendDragonKeys.
I've been experimenting with Microsoft Voice Typing since upgrading to Windows 11. Despite its many limitations compared to Dragon, it will enter text in fields that Dragon won't. Here's the interesting part. I can, of course, launch the app by dictating "press Windows H," but I decided to try for less of a mouthfull and wrote a macro containing the line SendKeys "{win+h}". It didn't work. Then I tried SendSystemKeys "{win+h}". That version worked, but it was a little slower than dictating "press Windows H." I also tried SendDragonKeys "{win+h}", but it didn't work, either. ------------------------- James McVay |
|
|
|
![]() |
|
If you're using DPI 15.61, try SendKeys "{WindowsHold}h" |
|
|
|
![]() |
|
Matt,
SendKeys "{WindowsHold}h" will work in KnowBrainer but unfortunately, not Dragon ------------------------- Change "No" to "Know" w/KnowBrainer 2022 |
|
|
|
![]() |
|
SendKeys "{WindowsHold}h" will work in KnowBrainer but unfortunately, not Dragon
Lunis, It works for me in DPI 15.61. Matt |
|
|
|
![]() |
|
That works. Thanks, Matt. By the way, I forgot to mention the main reason I'm experimenting with Microsoft Voice Typing. It accepts dictation in a number of languages other than the few offered by Nuance, including the two I translate from: Russian and Bulgarian. When I need to translate a scanned PDF file, I can easily look up terms in an online dictionary by dictating them. I still have to switch keyboards to Cyrillic, but I don't have to manually (and laboriously) type the terms. The keyboards for Russian and Bulgarian Cyrillic not only differ markedly from QWERTY, they differ from each other. ------------------------- James McVay |
|
|
|
![]() |
|
I think the point of SendSystemKeys is that it can handle the {win} key (and probably other system keys) whereas the others won't. The idea of the system keys is that they have special actions to the system itself rather than just being keys that you can send on to an application. For example, no application will ever see the {win} key in normal operation because the OS eats the {win} key for itself.
------------------------- Win10/11/x64, AMD Ryzen 7 3700X/3950X, 64/128GB RAM, Dragon 15.3, SP 7 Standard, SpeechStart, Office 365, KB 2017, Dragon Capture, Samson Meteor USB Desk Mic, Amazon YUWAKAYI headset, Klim and JUKSTG earbuds with microphones, excellent Sareville Wireless Mono Headset, 3 BenQ 2560x1440 monitors, Microsoft Sculpt Keyboard and Logitech G502 awesome gaming mouse. |
|
|
|
![]() |
|
Consider me shocked and corrected. I thought this was 1 of the only exceptions between Dragon and KnowBrainer scripts. clearly I should have tested this the 1st time
------------------------- Change "No" to "Know" w/KnowBrainer 2022 |
|
|
|
![]() |
|
Perhaps the {WindowsHold} functionality came in with the switch to WinWrap Basic, in 15.61? It's in the WinWrap Basic documentation. |
|
|
|
![]() |
|
Matt is correct in terms of the feature coming with WinWrap Basic. The Windows key functionality was added to WinWrap Basic, especially for KnowBrainer at the time in October 2015 by WinWrap with version v10.30.113, words of WinWrap in blue below. In terms of SendDragonKeys & SendSystemKeys they are extensions to WinWrap Basic implemented by Dragon.
Another significant event in the life of SendKeys was the Windows API methods used with WinWrap Basic. Previously SendKeys was implemented using the Windows Journal Playback Hook but now is implemented using the Windows API function SendInput.
"When Microsoft released Vista and UAC the Windows Journal Playback Hook became a privileged API only accessible when UAC is off. That's when WinWrap Basic switched to the SendInput API. I don't have any insight beyond that."
>>Lindsay, Okay, I took a couple of hours to revisit the very old code that implements the SendKeys command. I added two new key names {Windows} and {WindowsHold}. {WindowsHold} is a modifier (like %, + and ^) which affects the next key. v10.30.113 has been posted with this enhancement. E.g. SendKeys "{WindowsHold}r" ' Show the run dialog. SendKeys "{WIndowsHold}^f ' Show the find computers dialog SendKeys "{Windows}" ' press and release the Windows key.<< ------------------------- |
|
|
|
![]() |
|
The doc from Microsoft also says that SendKeys can switch between the old delivery method and the new SendInput method. If it can't deliver the preferred way, it apparently switches to another way. My (past) experiences trying to send the Windows key (with SendInput, I think) showed that I could only send particular Win+whatever combinations. Not all combinations are allowed; the os eats them and they never reach the app.
------------------------- Win10/11/x64, AMD Ryzen 7 3700X/3950X, 64/128GB RAM, Dragon 15.3, SP 7 Standard, SpeechStart, Office 365, KB 2017, Dragon Capture, Samson Meteor USB Desk Mic, Amazon YUWAKAYI headset, Klim and JUKSTG earbuds with microphones, excellent Sareville Wireless Mono Headset, 3 BenQ 2560x1440 monitors, Microsoft Sculpt Keyboard and Logitech G502 awesome gaming mouse. |
|
|
|
![]() |
|
Which Microsoft document would that be? WinWrap basic implements SendKeys using SendInput and simply doesn't miss a beat either sending the Windows key on its own or in a combination, it never switches to alternative methods. I also have my own C# & C++ implementation of sendinput and again is 100% reliable. It was a replacement for the keyboard and mouse event APIs as well as to overcome journal playback issues although they are still accessible.
I would find hard to believe that Windows messaging swallows sendinput messages unless the implementation of SendInput is less than perfect.Otherwise you will probably find that it is a firewall or other Guard software that prevents sending keystrokes using SendInput
------------------------- |
|
|
|
![]() |
|
------------------------- Dragon Professional Individual v15.6. Windows 10. Knowbrainer 2017. |
|
|
|
![]() |
|
I don't think you'll notice the speed difference. A single, simple SendSystemkeys instruction should run quite fast.
|
|
|
FuseTalk Standard Edition v4.0 - © 1999-2023 FuseTalk™ Inc. All rights reserved.