![]() |
KnowBrainer Speech Recognition | ![]() |
Topic Title: Advanced scripting command sends modifier key twice Topic Summary: Created On: 02/23/2022 07:00 PM Status: Post and Reply |
|
![]() |
![]() |
- wristofdoom | - 02/23/2022 07:00 PM |
![]() |
![]() |
- Alan Cantor | - 02/23/2022 11:46 PM |
![]() |
![]() |
- Lunis Orcutt | - 02/24/2022 02:56 PM |
![]() |
![]() |
- wristofdoom | - 02/24/2022 05:06 PM |
![]() |
![]() |
- wristofdoom | - 02/24/2022 01:57 AM |
![]() |
![]() |
- Ag | - 02/24/2022 09:22 PM |
![]() |
![]() |
- wristofdoom | - 02/25/2022 12:50 AM |
![]() |
![]() |
- Edgar | - 02/25/2022 10:03 AM |
![]() |
|
I have an Autohotkey script that does various things to media using the Windows and F-row hotkeys. For example, Windows+F7 will play or pause the current song in my media player.
I'm trying to create a Dragon advanced script that will trigger these same hotkeys.
Here's my full code: https://pastebin.com/0kakwVsy
It works, but with a catch: after I dictate a command like "pause track", the desired action is performed (Windows + F7 is sent and the track pauses), but then it also behaves as though the Windows key has been pressed a 2nd time.
Note: I have stickey keys enabled. However, I have many other commands that send modifier keys like this, and this behavior does not occur.
So, if I were to press the "up arrow" key after using this command, then my window will resize (the equivalent of pressing Windows key + up arrow).
I've tried this with other modifier keys with the same results. For example, if I change the hotkey to shift + F7, then if I utter the command "pause track" and then afterwards I click somewhere with the mouse, it will behave as though I have done a "shift click".
So it's almost like instead of sending "+{F7}" it's sending "+{F7}+"
Any ideas what could be going on here?
Thanks
Update:
I haven't figured out the original issue, but I was able to get an advance script working that controls media directly without involving Autohotkeys, funky pop-ups, or other third-party scripting.
Code is here for anybody interested:
------------------------- Dragon Professional Individual v15.6. Windows 10. Knowbrainer 2017. |
|
|
|
![]() |
|
Any ideas what could be going on here? Not 100% sure, but I suspect the problem resides in statements like this: SendKeys "{Windowshold}{F8}", 1 Perhaps the Windows key isn't released after it is held, which triggers the Start menu? You might need to change the hotkey activations for the AutoHotkey scripts. Maybe Ctrl + Alt + function keys? |
|
|
|
![]() |
|
Will SendKeys "{WindowsHold}{F8}" work? ------------------------- Change "No" to "Know" w/KnowBrainer 2022 |
|
|
|
![]() |
|
No, that's the code that wasn't working originally. ------------------------- Dragon Professional Individual v15.6. Windows 10. Knowbrainer 2017. |
|
|
|
![]() |
|
Thanks but not the solution unfortunately. I've tried this with other modifier keys with the same results. For example, if I change the hotkey to shift + F7, then if I utter the command "pause track" and then afterwards I click somewhere with the mouse, it will behave as though I have done a "shift click".
------------------------- Dragon Professional Individual v15.6. Windows 10. Knowbrainer 2017. |
|
|
|
![]() |
|
If your original autohotkey script works fine, but your Dragon Basic script doesn't...
(AutoHotKey handling of Windows key via the # modifier, or {LWin up/down} etc seems more mature than Dragon's) ... why not just have your Dragon speech command invoke your AutoHotKey script? (Or more likely a tweaked AHK script.) ------------------------- DPG15.6 (also DPI 15.3) + KB, Sennheiser MB Pro 1 UC ML, BTD 800 dongle, Windows 10 Pro, MS Surface Book 3, Intel Core i7-1065G7 CPU @ 1.3/1.5GHz (4 cores, 8 logical, GPU=NVIDIA Quadro RTX 3000 with Max-Q Design. |
|
|
|
![]() |
|
How would I go about doing that? ------------------------- Dragon Professional Individual v15.6. Windows 10. Knowbrainer 2017. |
|
|
|
![]() |
|
just do something like this: Sub Main ShellExecute "D:\RearrangeVisualStudio\RearrangeVisualStudio.exe" End Sub In your case, what would be inside the quotation marks would be the full path to the script you want to run. This can be accomplished with DVC as well as traditional Advanced Scripting. ------------------------- -Edgar |
|
|
FuseTalk Standard Edition v4.0 - © 1999-2023 FuseTalk™ Inc. All rights reserved.