![]() |
KnowBrainer Speech Recognition | ![]() |
Topic Title: Squelching: Automatically ignore dictation in certain windows (at certain times) Topic Summary: Preventing unmodified key shortcuts that go crazy if you dictate by accident Created On: 06/23/2020 02:03 AM Status: Post and Reply |
|
![]() |
![]() |
- Ag | - 06/23/2020 02:03 AM |
![]() |
![]() |
- Ag | - 06/23/2020 06:31 PM |
![]() |
![]() |
- Ag | - 06/25/2020 03:07 AM |
![]() |
![]() |
- Mav | - 06/25/2020 08:42 AM |
![]() |
![]() |
- Ag | - 06/25/2020 10:04 PM |
![]() |
![]() |
- Mav | - 06/26/2020 04:04 AM |
![]() |
![]() |
- Alan Cantor | - 06/25/2020 10:47 AM |
![]() |
![]() |
- kkkwj | - 06/25/2020 02:40 PM |
![]() |
![]() |
- Ag | - 06/25/2020 09:56 PM |
![]() |
![]() |
- Alan Cantor | - 06/25/2020 03:23 PM |
![]() |
![]() |
- PG LTU | - 06/25/2020 05:12 PM |
![]() |
![]() |
- Ag | - 06/25/2020 10:07 PM |
![]() |
![]() |
- Ag | - 05/26/2023 01:16 AM |
![]() |
![]() |
- Ag | - 08/21/2023 10:34 PM |
![]() |
|
Originally I called this: Automatically switch to command mode in certain windows. Later, I changed the name to: Automatically ignore dictation in certain windows. Now, still later, I am adding "at certain times" to the title.
Of course, what I really want is in certain fields of certain windows accept dictation, while in others windows accept/reject dictation wholescale. All for the same app.
LATER (5/25/2023): I now call this "Dictation Squelching".
Since my BKM doesn't switch to command mode, but ignores all unmodified letters.
The problem I was solving is that if you accidentally dictate into a window like Thunderbird that uses unmodified single letter key shortcuts, things go badly. So I want to disable such dictation by default, automatically, without having to say "Switch to Command Mode" - I.e. before I have accidentally deleted or misfiled email.
I would prefer to automatically switch to command mode, because my AHK hack is unnatural, and poses challenges for command writing. But it's all I have so far.
LATER: I implemented automatically switching to command mode, and it turned out to be quite unpleasant. Many things that you might say by accident will get mapped to commands of completely different names in command mode, whereas when you are just squelching dictation they are ignored. Squelching dictation is better.
---
For various reasons I use Thunderbird email. Not speech ready. LATER: similar problems with many different programs, not just Thunderbird. See below
I have commands to emit the appropriate keyboard control sequences. That's okay.
However, Thunderbird has quiter a few single key, unmodified, keyboard shortcuts. Like A archive R mark thread as read M mark message as read K mark as junk S toggle star
If I am in normal mode, and I utter something that Dragon interprets as dictation, Dragon sends the letters - and if one of the letters is as above, it's easy to have email accidentally arcvhived, marlerd as junk, etc. I.e. it os easy to lose email messages this way - not necessarily delete them, but if they are removed from my Inbox or other folder without my noticing, not good.
Q: is there any way to prevent Dragon from inserting dictaion? AUTOMATICALLY?
Sure, I know about the Force Command/Dictayion hotkeys, Ctrl/Shift.
First, these seem to interfere with SendKeys emitted by by Dragon/KmnowBrainer commands. E.g. if I have Ctrl pressed to force Commands, then every SendKeys in my commands will have the Ctrl modifier. (Or at least that seems to be the case - am I doing something wrong?)
Second, I don't want to have to remember to hit Ctrl to Force Commands. Especially since I am not at a keyboard most of the time. Or to do "Start Command Mode". I want this to be done automatically, whenever I enter or activate the Thunderbird reading window "*- Mozilla Thunderbird". (But not in the writing window.)
I can write AutoHotKey to detect WinActivate... and theoretically then turn Command Mode On (and off on exit). Here I'm just lazy - I haven't been able to get AHK to control the DragonBar well enough to change "Now listening for...".
I can actually arrange for AHK to intercept all unmodified keys typed in the Thunderbird main window, silencing them. Can't distinguish those from Dragon dictation and those from keyboard, but I can use heuristics. (Wait, the actual event stream indicates the HID, doesn't it? AHK_HID...) Then after that, muist arrange to either not do this when a Dragon/KnowBrainer command is sendkeying... or else have the speech command invoke an AHK script via ShellExecute to do the actual work.
--
Basically, as usual, I am lazy, and I hope that somebody else has already done something like this.
Just asking...
And if not already done, I welcome suggestions as to better ways.
===
Although Thunderbird is the app that I have run into this today, this issue may arise on any app that has non-modified single key shirtcuts.
------------------------- 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. |
|
|
|
![]() |
|
Simple AHK In Force lowercase mode? I use a similar script, which accomplishes global Lowercase mode for Thunderbird. unfortunately not for OneNote. At least not yet :-(
------------------------- 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. |
|
|
|
![]() |
|
After using this for a day, I am pretty happy. I have merged the kill_letters and the force_lowercase functionality into a single AHK script, mainly so that I can bind it all to CAPS_LOCK (w/wo modifiers). Of course, "press caps lock", etc., control things from speech, along with speech commands like "kill letters on/off" and "lowercase on/off". But the main point is that I don't normally need to change the things, the default is that kill_letters is on, and only effective in the main Thunderbird window.
So far I have mainly had to switch several of my commands like "... archive" to use keybd_event to hold down ALT while navigating the menus. This will fall down when I need to have the commands enter letters, but those mostly live only in the message composition window. For searches I have to turn kill letters on/off, but I usually use Gmail search. Eventually I will need search commands that turn kill off as needed, without requiring separate commands. Early days, but I think I am much less frustrated with Thunderbird+speech right now. I don't think I've had accidental dictation pop up crazy menus and throw email around as I was having before I disabled unmodified letter keys. Enough so that I just removed the confirmation step in my archive command, It works more reliably. This technique will help any system that has a single key unmodified letter shortcuts. IIRC gmail, chrome, firefox. Although those usually have better ways of disabling keyboard shortcuts than Thunderbird currently does (the latest versions of Thunderbird broke most addons). Still, it's nice to have something that will work anywhere. ------------------------- 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. |
|
|
|
![]() |
|
Take a look at your nsuser.ini file located at %appdata%\Nuance\NaturallySpeaking15.
You can tell Dragon to activate/deactivate dictation support in certain applications by adding a section [executableName|executableVersion\Compatibility Module Status]
In this section you add
Edit Control Support=0
now Dragon should stop writing into this application. I've tried with Notepad and it worked: [notepad|10.0\Compatibility Module Status}
As a side note: Dragon seems to monitor nsuser.ini for changes, so no need to restart Dragon after each modification. Just select a different window to apply your changes.
hth, mav |
|
|
|
![]() |
|
It looks like nsuser.ini disables dictation
a) on a per-app basis, not differently per window of the same app
b) statically
It turns out that in Thunderbird I need to dictate in the main window, in places like the search box. But not in otheer places of the same main window. Panes. (What a pain main panes are!! :-)
I will change the topic to "at certain times".
------------------------- 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. |
|
|
|
![]() |
|
Yes, nsuser.ini only works on application basis, not single windows within an application. Sorry, didn't understand your requirement good enough. mav |
|
|
|
![]() |
|
Does Thunderbird provide an option to disable those keyboard shortcuts?
I'm not 100% sure, but I think there is an webmail program that offers users different sets of keyboard shortcuts. If Thunderbird is one of those, is there an option for a set of hotkeys that always use modifiers? Or is there an option to to toggle off the keyboard shortcuts? As someone who needs to avoid using a mouse, I find single-character shortcuts get in my way, as they are too easy to activate by accident. When a shortcut is activated, it's a problem if the action performed happens with inadequate or no visual feedback. I turn off single key shortcuts whenever I can. When keyboard interaction with web applications is poorly implemented or absent, I use macro software (Macro Express and/or AutoHotkey) to develop "virtually keyboard interfaces." But developing a RELIABLE virtual keyboard interface is a challenging scripting project. I find these projects are simpler with Macro Express or AutoHotkey than with Dragon Advanced Scripting. Once the set of custom keyboard commands work reliably, it's straightforward to voice-enable them. For example, if Alt + S is my keyboard shortcut to navigate to the "Sent" messages folder, then my "Go to Sent" Dragon command might be this: SendDragonKeys "{Alt+s}" |
|
|
|
![]() |
|
Hi Alan, if I understand you correctly, you proceed as follows: 1) Define a VKI "virtual keyboard interface" as a set of keybindings and actions. 2) Implement the VKI using MacroExpress, or AHK, or a combination of them. 3) When things settle down, define voice Dragon or KB scripts to fire the keystrokes.
When you say that defining a reasonable VKI is a challenging scripting project, what exactly do you mean? Are you referring to the VKI specification or to ME, AHK, or Dragon/KB? Thank you. ------------------------- 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. |
|
|
|
![]() |
|
There are several Thunderbird packages to configure keyboard shortcuts, but all of them as far as I know stopped working completely reworked its add-on architecture.
E.g. Dorando keyconfig stopped working at Thunderbird 5.0b1 - 60.*, and Thunderbird is now at v68. Although to 60.*->68 transition was only circa Oct 2019.
Although I would probably have just disabled Thunderbird single key shortcuts if the package was available, there are some advantages to having this reality. E.g. I can use it for similar shorcut situations in other apps. I may still go back to the earlier versions of Thuunderbird. I did not switch; I had not used Thunderbird in years before I returned to it circa March.
------------------------- 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. |
|
|
|
![]() |
|
When you say that defining a reasonable VKI is a challenging scripting project, what exactly do you mean? Are you referring to the VKI specification or to ME, AHK, or Dragon/KB? I mean these projects usually take time and effort. How much time and effort? That depends mostly on the web application, sometimes on the browser, and occasionally on the operating system. Whether I use Macro Express or AutoHotkey is a comparatively minor issue. Both have their advantages and disadvantages. Typically, it doesn't take long to develop a handful of macros. But refining the macros so they work reliably tends to consume much more time. |
|
|
|
![]() |
|
Just thought of this.
How about a command called "switch to thunderbird" that switches to thunderbird (appbringup, heardword, whatever) and then switches to command mode right away?
Your "new email" command could include switching back to normal mode to allow the message composition:
And then your "send email" or "move to draft" commands could do the switching to command mode to put you back. You get the idea, I guess? -------------------------
|
|
|
|
![]() |
|
Helps, yes, I already had that.
But there's a difference between putting it in a command, and having it done automatically based on context. ------------------------- 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. |
|
|
|
![]() |
|
WIP status update: I have been working on/using this quite a lot recently, and I intend to write a longer descriptive post. But for now, briefly ...
---
And in case anyone cares: I am doing things like turning off dictation squelching when I'm in the search box of the eMclient window, but turning it on elsewhere in that same window. Same window, same window title, same control ... in other words no way for Dragon to distinguish the search box context where I want dictation from the message list where I do not. At the moment I am using the XY coordinates of the text cursor/caret. it looks like I will be able to use UIA to make a slightly better distinction. ------------------------- 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. |
|
|
|
![]() |
|
STATUS REPORT: I remain reasonably happy with the version of dictation squelching that
a) Squelches dictation by turningDragonCapture AutoPaste on/off a.1) using AutoHotKey Control,Check/Uncheck a.2) Although it was unfortunately necessary to save/restore the currently active window b) automatically invoked on mouse left clicks c) automatically invoked at OnExit of my AutoHotKey based speech commands shortcomings: * I would really prefer this to be 100% automatic, e.g. when a dialog box is opened by physically typing AQI, or by saying "press key" or the like. * I did hook such focus change events, but they seemed to interfere with scripts that were themselves opening and closing windows and dialogs * e.g. it is unfortunate that AutoHotKey control cchecck/uncheck changes window focus * also, I was only able to hook changes between application window focus, and I did not intercept ffocus changes within an application, like opening or closing DialogBox. ** however, I'm pretty sure I know how to do that, it just doesn't seem worthwhile because of the interference issue it might be possible to avoid the interference issue by recording the need to determine if squelching is necessary, but not performing it immediately, instead waiting until there is some sort of quiescence in which no commands are pending. ------------------------- 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. |
|
|
FuseTalk Standard Edition v4.0 - © 1999-2023 FuseTalk™ Inc. All rights reserved.