Sending Windows and Control Key
Hi All,
I'm now torn between the world of Dragon Naturally Speaking (DNS) and Windows Speech Recognition (WSR). This adds some complexity but I get to test out the advantages and disadvantages of the two distict systems. So far I am getting much faster system recognition and response times for Windows command recognition but better continous recognition performance from DNS. I really appreciate the added funtionality brought to me by Unimacro/Natlink especially for the mouseless browsing functions in Firefox and the ability to navigate directly to folders from within Windows Explorer.
What I would like to be able to achieve is seamless switching between the two separate systems. For example if I say "Command Mode" the system will turn off my Dragon Mic via Sending keys {Ctrl}m and then turn on Windows Speech Recognition by sending the {Ctrl}{Win} keystroke combination. To switch the other way the process is reversed. Whilst easy to do form the windows side, it is proving rather more difficult from the Dragon side as there is no easy way for Dragon Scripting to send {Ctrl}{Win}
There was a suggestion in another thread that the only way to do this was via a custom dll, the link to the dll does not now seem to be active 
http://www.speechcomputing.com/node/404
I am sure that there is a way Unimacro/Python could do what I need, but I am unable to work out what to do. I beleive there was functionality added to enable pressing the windows key with the latest release.
So to sum up all I need to be able to do is send {Ctrl}{Win} either through a custom dll or via Python.
Any help is most appreciated.
Kind regards
Austin

I do not have natlink
I do not have natlink switched on, so cannot test this just now.
The control key can be pushed possibly with SendKeys "{ctrl}" but I fear this does not work. With playEvents it can be done, look for playEvents examples in natlink documentation or in the unimacro python files.
The windows key is done through the "winkey.dll" file. This one is somewhere in the unimacro (natlink/vocola) installation files. It can be executed with the WINKEY unimacro shorthand command. See http://qh.antenna.nl/unimacro/features/actions/sho...
Documentation about natlink still on http://www.synapseadaptive.com/joel/pythonamacroas...
Also see the file natlink.txt in the natlink/miscscripts subdirectory of natlink.
Hope this helps,
Quintijn
Hmm, have you tried
Hmm, have you tried SendDragonKeys? Help's SendKeys cites the putative topic "Key names for SendDragonKeys", but I can't find it, so maybe its another glitch in the progressively raggedy help file system. Still, it seems to me that if {Ctrl}{Win} doesn't work, then maybe {Ctrl+Win} should be tried. There is also the SendSystemKeys function, but I think its essentially the same as SendDragonKeys -- neither are listed in DNS' own Help files SFAIK, but Larry Allen's scripting text (http://www.pcspeak.com/scripting10/) groups them. This text, BTW, is a great learning tool, but its not a substitute for a proper Help file.
Bruce
PS: After further review, none of the above is likely to be useful for what you want to do, i.e., to use the Windows key as another shift-key, like Ctrl, Alt or Shift. I think you do need to track down the DLL referenced by Quintijn. Sorry.
I agree this is not a clear
I agree this is not a clear solution, and I sorry about SendKeys and SendDragonKeys confusion.
How about pushing down the ctrl-key with natlink.playEvents, and release again (also with playEvents), and after that push down the ctrl-key, do the windows key with "WINKEY" (unimacro) and then release the ctrl-key again? Something like that...
Things could be built likewise with AdvancedScript, same tactics.
Quintijn
Thanks for the Quick Replies
Bruce and Quintijn,
I appreciate both of your answers. I think what you are suggesting Quintijn offersa practical solution. I will try and work out how to do this. I am still marginally scared to try this and not 100% sure how I can get a Python script to run via Natlink which will press and hold the control key, then wait whilst unimacro executes the Windows key and then natlink Python will then release the control key. From my understanding this is what you are suggesting correct? I still think a cleaner solution would be to execute the lot using a custom dll but alas my programming skills are also lacking in this department, I will work it out soon. I was just kind of hoping there would bea quick solution out there already. After all this topic has been discussed before in other threads. The link to speechwiki was dead last time I tried so if there was a dll solution it seems to have drifted of into cyberspace for the time being!
If iI manage to make any progress I'll keep you posted.
Thanks again for the suggestions.
Kind regards
Austin
Austin, The link provided by
Austin,
The link provided by Rwilke to the post by Bruce Tjsovold on the KnowBrainer forum seems to be exactly what you need.
I have another question that's nagging me: In your context is it absolutely necessary to use that particular keystroke combo?
Bruce
Here's a link to that WinKey DLL
Some days ago, I posted the question on the Knowbrainer forum if someone could provide the link you are asking about here also.
Gratefully, Bruce Tjsovold replied to this pretty fast, thanks again for that, Bruce.
You can download the DLL by going to the link below. It works like a charm.
Good luck
Rüdiger Wilke
http://www.knowbrainer.com/pubforum/index.cfm?page...
Cheers
@Rudiger, thanks for this link. I'll try and work out how to use it now. Do you have any script samples you are willing to share or installation advice to let us know how you got it to work. I would be much obliged if you do!!
@Bruce Unfortunately WSR (currently) does not allow you to assign a custom microphone toggle hotkey. Hence it is assigned to {Ctrl}{Win}. Interestingly the WSR Macros make it easy to access this shortcut. The problem arises when trying to switch off DNS and switch on WSR. DNS is not able to send this key sequence easily hence the requirement for the dll. Hopefully I can get this to work tomorrow without too many headaches! It seems like a simple thing but this will make a big difference for seamless switches between systems.
Thanks guys.
Austin, you're welcome.
Austin,
you're welcome. There's a brief install guide along with the download, giving you the example you need. It's just a piece of cake.
See you
Rüdiger
The dll is also on the
The same dll is also on the unimacro release (with natlink/vocola). (The unimacro shorthand command WINKEY uses this dll.)
The dll is also on my website: http://qh.antenna.nl/en/speechrecognition/switchin...
I did not delve exactly into your wishes, but I think I understood the following: NatSpeak (through AdvancedScript or through a natlink (unimacro) command) should press a key to switch off the microphone for itself and then press a key to switch on the microphone for WSR. That is how people did years ago when concurrently using DragonDictate and NatSpeak.
With natlink (unimacro) you need one command which just performs this, just pressing these 2 keys. This command calls back into just ONE function inside one of the python grammar files.
Quintijn
Update
Dear all,
I get the DllCall to work with the following script.
Sub Main
‘turn off DNS microphone
SetMicrophone 0
‘open explorer
DllCall "DNSKeys","WinKey","e"
End Sub
However, I can’t get the combination of windows and control key to work
Sub Main
‘turn off DNS microphone
SetMicrophone 0
‘turn on WSR microphone
DllCall "DNSKeys","WinKey","{Ctrl}"
End Sub
I’ve tried various combinations of the control key i.e “Ctrl” “^” “Control” but none seem to work on my system. I’m not sure whether or not the {WinKey}{Control} is possible with this Dll, maybe the Dll requires to be modified to permit modifier keys also. I think Quitijn idea of using Natlink to press the Control key down then press the WinKey and finally release the control key is the best solution. I will take a look at how I can do this. My trouble is that it is difficult for me to know exactly what code I need to extract from a natlink python template, what imports need to be made. I realise this should be a relatively simple python script. I have looked at the action.py in the Unimacro distribution and I am sure that therein lies the answer. I am just not sure how to tie the whole thing together! I’ll keep you posted.
Austin, Pure speculation on
Austin,
Pure speculation on my part, but as suggested before I think something "like" {Ctrl+Winkey}" or "^{Winkey}" might work. I say "like" because I don't know the exact usage -- however you would indicate that the Ctrl key is used as a shift or modifier key of the {Winkey}.
HTH,
Bruce
Please try this one:
Please try this one:
DllCall "DNSKeys","WinKey",""
SendDragonKeys "{ctrl}"
I use this trick in order to temporarily disable my Dragon shortcut.
Gerrit van Wijk
see my post on: http://www.knowbrainer.com/pubforum/index.cfm?page...
Thanks for the suggestion
Guys,
I now have a solution I created a c++ application that does the keystrokes for me using cSendKeys, (look it up on Google ifyou are interested). Strange thing is that if this application is called directly from DNS via AppBringUp it messes up the sequence of Windows keys after a few switches. The virtual keystrokes seem to drift around in windows like ghosts. The solution was to create a seperate application which calls the c++ console application. In this way it works perfectly and I am one happy man. What you have to do to create a simple keypress!! They really do make these systems very easy to use, I bet it must be all that user research that they spend billions on that helps them design such user freindly systems!
Thanks everyone for the suggestions, it's been very much appreciated.
Another thought: Its easy
Another thought: Its easy to change the Microphone On key assignment in DNS, so maybe you could do the same in WSR.
Bruce
Good Idea but
@ Bruce Thanks for this suggestion but I already indicated why this is not feasible in an answer to you above!
austindimmer wrote: @ Bruce
@ Bruce Thanks for this suggestion but I already indicated why this is not feasible in an answer to you above!
Austin,
Yes, sorry, you did -- short attention span. Maybe they'll fix this with the upcoming introduction of Windows 7.
Bruce
BruceCyr wrote: Yes, sorry,
Yes, sorry, you did -- short attention span. Maybe they'll fix this with the upcoming introduction of Windows 7.
Bruce, I sincerely believe that an upgrade to Bruce 2.0 would be better at fixing a short attention span. I understand Windows 7 is only for very long attention spans due to it's inherent snail DNA.
admin wrote: BruceCyr
Yes, sorry, you did -- short attention span. Maybe they'll fix this with the upcoming introduction of Windows 7.
Bruce, I sincerely believe that an upgrade to Bruce 2.0 would be better at fixing a short attention span. I understand Windows 7 is only for very long attention spans due to it's inherent snail DNA.
Skip,
I regret to report that this particular model has been discontinued and is not user-upgradable
I'm hoping that by the time W7 appears I can switch to Apple and the Parallels utility.
Bruce