KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: Looking for tool to generate KnowBrainer/Dragon/... commands from list of keyboard shortcuts
Topic Summary: In case anybody has already written this...
Created On: 02/13/2020 10:38 PM
Status: Post and Reply
Linear : Threading : Single : Branch
 Looking for tool to generate KnowBrainer/Dragon/... commands from list of keyboard shortcuts   - Ag - 02/13/2020 10:38 PM  
 Looking for tool to generate KnowBrainer/Dragon/... commands from list of keyboard shortcuts   - PG LTU - 02/14/2020 09:48 AM  
 Looking for tool to generate KnowBrainer/Dragon/... commands from list of keyboard shortcuts   - Edgar - 02/14/2020 10:53 AM  
 Looking for tool to generate KnowBrainer/Dragon/... commands from list of keyboard shortcuts   - Edgar - 02/14/2020 11:02 AM  
 Looking for tool to generate KnowBrainer/Dragon/... commands from list of keyboard shortcuts   - Lunis Orcutt - 02/14/2020 02:38 PM  
 Looking for tool to generate KnowBrainer/Dragon/... commands from list of keyboard shortcuts   - Lunis Orcutt - 02/14/2020 03:37 PM  
 Looking for tool to generate KnowBrainer/Dragon/... commands from list of keyboard shortcuts   - kkkwj - 02/14/2020 11:33 PM  
 Looking for tool to generate KnowBrainer/Dragon/... commands from list of keyboard shortcuts   - Edgar - 02/15/2020 11:30 AM  
 Looking for tool to generate KnowBrainer/Dragon/... commands from list of keyboard shortcuts   - Mphillipson - 02/15/2020 11:52 AM  
 Looking for tool to generate KnowBrainer/Dragon/... commands from list of keyboard shortcuts   - PG LTU - 02/16/2020 03:08 PM  
 Looking for tool to generate KnowBrainer/Dragon/... commands from list of keyboard shortcuts   - monkey8 - 02/18/2020 06:11 PM  
 Looking for tool to generate KnowBrainer/Dragon/... commands from list of keyboard shortcuts   - Ag - 03/15/2020 08:03 PM  
 Looking for tool to generate KnowBrainer/Dragon/... commands from list of keyboard shortcuts   - Mphillipson - 03/25/2020 02:04 PM  
 Looking for tool to generate KnowBrainer/Dragon/... commands from list of keyboard shortcuts   - Ag - 03/15/2020 08:01 PM  
 Looking for tool to generate KnowBrainer/Dragon/... commands from list of keyboard shortcuts   - dilligence - 03/16/2020 12:19 AM  
 Looking for tool to generate KnowBrainer/Dragon/... commands from list of keyboard shortcuts   - kkkwj - 03/24/2020 11:29 PM  
 Looking for tool to generate KnowBrainer/Dragon/... commands from list of keyboard shortcuts   - R. Wilke - 03/25/2020 03:47 AM  
 Looking for tool to generate KnowBrainer/Dragon/... commands from list of keyboard shortcuts   - kkkwj - 03/25/2020 11:08 AM  
 Looking for tool to generate KnowBrainer/Dragon/... commands from list of keyboard shortcuts   - Bingos - 04/13/2020 01:29 AM  
 Looking for tool to generate KnowBrainer/Dragon/... commands from list of keyboard shortcuts   - Ag - 02/25/2021 11:31 PM  
Keyword
 02/13/2020 10:38 PM
User is offline View Users Profile Print this message

Author Icon
Ag
Top-Tier Member

Posts: 560
Joined: 07/08/2019

Example 1:

So, I have finally started using Microsoft Edge with the Dragon/KnowBrainer. There are a few things that I know how to do via keyboard shortcuts that I don't have speech commands for. [*].

Here's a list of keyboard shortcuts:

https://support.microsoft.com/en-us/help/4531783/microsoft-edge-keyboard-shortcuts

the 1st few lines look something like

 

Press this key To do this
Ctrl + D
Save your current webpage as a favorite
Ctrl + E Open a search query in the address bar
Ctrl + F Find on page
Ctrl + G Jump to the next match in your Find Bar search

and so on

 

Seems to me I might like to have pretty much all of these keyboard shortcuts as speech commands.

 

Q: has anyone written a script (Perl/Python/whatever) that will take a list such as that above and generate a set of speech commands?

 

The descriptions in the "To do this" column are little bit verbose, and I probably would want to massage them. But in many cases they are actually a good start for command names.

 

Since I put a prefix like "PUFF" or "ZUFF" or "ZOTZ" in front of all my commands, I don't have to worry about conflict thing with normal dictation.  I might have to worry about constantly with commands that I've already written, but hey, that's what a script can do.

 

It should be easy enough to add the appropriate waits between SendKeys. However, in this example, these are all single key shortcuts, nothing needed.

 

So I imagine I might have an input file that looks something like

 

Ctrl + D :: Set Favorite

Ctrl + E :: Search web

Ctrl + F :: Find

Ctrl + G :: Next Match

... Let's see, let's find a few more interesting things

Ctrl + Shift + M :: switch user

Ctrl + Shift + R :: flush cache

 

And so on.

 

Doesn't look like a hard script to write. I'm just asking in case anybody's already written such a script, and is willing to share.

 

There are lists of such keyboard shortcuts all over the web. KnowBrainer has commands for a few of these, but by no means all. (I think people who use on prefixed commands have to be a lot more careful in choosing command names that don't conflict with stuff they ordinarily want to say in normal mode.)

 

---

 

Note *: yeah, I need to spend some time updating I KnowBrainer. Perhaps the latest KnowBrainer release has already added all of the commands I could possibly want. But I doubt it. Especially when I get the more technical applications. Visio? The various GitHub shortcuts for IOssues/Wikis/... ?

 

 

 

 



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

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.



 02/14/2020 09:48 AM
User is offline View Users Profile Print this message

Author Icon
PG LTU
Top-Tier Member

Posts: 2134
Joined: 03/21/2007

I have such a tool, called "Make Dragon Commands". It takes in a csv file of command names and shortcuts and generates application-specific DVCs (and a customized "What Can I Say" glossary).

Here from the help:

IN SHORT:

1. SET UP a CSV file of COMMAND NAMEs and KEYBOARD SHORTCUTs (using SendSystemKeys key names).
2. RUN Make Dragon Commands to create a Dragon XML file.
3. IMPORT this XML file into the Dragon Command Browser and, when done,
4. Change the properties of the newly imported commands (they will be set to the Make Dragon Commands application) to specify the actual specific application you want (the program should be running to show up in the drop-down list). When you are all done,
5. GO into the application and say "What Can I Say" to see your commands.
6. Have fun!

Send me your email by pm and let's see if it helps you . . .


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




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.

 02/14/2020 10:53 AM
User is offline View Users Profile Print this message

Author Icon
Edgar
Top-Tier Member

Posts: 1109
Joined: 04/03/2009

I also wrote a script which does almost exactly what PG's does - writes an XML file which is then imported into KnowBrainer. I went the route of hard-coding the application specific detail into the script so the script had to be changed for each application. I also hard-coded the iterations (number of commands be created) as it was easier than writing the code to "keep doing until EOF". I also did not bother to write code to open a (text) file for input and another for output; I just had the input text file open in a text editor on the left side of the screen and the output XML file open in a text editor on the right side of the screen. I would make sure that I started out with the text cursor on the first line of the input file and a blank line immediately after the XML header of the output file, then, using basic commands like
SendKeys "{Home}", 1' ensure cursor is at the beginning of the line
SendKeys "+{End}", 1' select to end of line
SendKeys "^c", 1' copy selection to clipboard (the Clipboard function is unreliable on my system)
Wait 0.3' my system requires a wait
SendKeys "{Down}", 1' prepare the input text editor for the next iteration
SetMousePosition 0, 1000, 10' over the output file's Title Bar
Wait 0.1
ButtonClick 1, 1' activates the output file text editor
line = Clipboard
Wait 0.3
' parse line to create the information required for the XML file's command structure
' use SendKeys to print out the command then
SendKeys "{Enter}", 1' add a blank line so that the text editor is ready for the next iteration
SetMousePosition 0, 100, 10' over the input file's Title Bar
Wait 0.1
ButtonClick 1, 1' activates the input file text editor

Put the above (untested) code in a "For" loop with hard-coated values values of "1 to XXX" where XXX is the number of lines/shortcuts in the input file.



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

-Edgar
DPI 15.3, 64-bit Windows 10 Pro, OpenOffice & Office 365, Norton Security, Shure X2U XLR to USB mic adapter with Audio Technica DB135 vocal mic, Asus X299-Deluxe Prime, Intel Core i9-7940X (14 core, 4.3 GHz overclocked to 4.9 GHz), G.SKILL TridentZ Series 64GB (4 x 16GB) DDR4 3333 (PC4 26600) F4-3333C16Q-64GTZ, NVIDIA GIGABYTE GeForce GTX 1060 GV-N1060G1 GAMING-6GD REV 2.0 6GB graphics card with 3 1920x1080 monitors



 02/14/2020 11:02 AM
User is offline View Users Profile Print this message

Author Icon
Edgar
Top-Tier Member

Posts: 1109
Joined: 04/03/2009

I use a spreadsheet application (e.g. Excel) to prepare the information for the input file. Typically, what you copied from the web will be a table which can be pasted directly into the spreadsheet with the description in one column and the actual shortcut in another column. This is fairly easy to edit - especially the description which needs to be massaged to become the command name. Select all the shortcuts and descriptions in the spreadsheet, copy them, then paste the result into a text file (I use PSPad as my text editor here - it makes it easy to replace the tabs between the shortcut and the description (which is what happens when you paste a table from a spreadsheet into a plain text editor); I would probably use a semi-colon as my separator but you could probably leave the tab and separate the line on it. It also conveniently numbers the lines so I know exactly how many iterations I need.

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

-Edgar
DPI 15.3, 64-bit Windows 10 Pro, OpenOffice & Office 365, Norton Security, Shure X2U XLR to USB mic adapter with Audio Technica DB135 vocal mic, Asus X299-Deluxe Prime, Intel Core i9-7940X (14 core, 4.3 GHz overclocked to 4.9 GHz), G.SKILL TridentZ Series 64GB (4 x 16GB) DDR4 3333 (PC4 26600) F4-3333C16Q-64GTZ, NVIDIA GIGABYTE GeForce GTX 1060 GV-N1060G1 GAMING-6GD REV 2.0 6GB graphics card with 3 1920x1080 monitors

 02/14/2020 02:38 PM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 38667
Joined: 10/01/2006

These commands are already in KnowBrainer:


Ctrl+D = Bookmark This Page

Ctrl+E = We just added Search but you have much better options. Try saying Search for <Lunis Star Trek> and click the 2nd link if you get bored. HOWEVER, our favorite search command is Google for <dictation> which we prefer over the other options.

Ctrl+F = Find On Page but why waste time when you can say Find <KnowBrainer> and save a step.

Ctrl+G ~ OK, you stumped the chump on this 1 so we just added Next Match to <%> KB Build 2-14-2020, which is available now.

 

Creating these types of KnowBrainer commands with VerbalBasic couldn't be easier. Since KnowBrainer already has a Microsoft Edge application specific Bookmark This Page command, try creating a Microsoft Edge application specific Bookmark command via the following blazing fast 2 steps:


1. Say New App Command <bookmark> (do not touch your mouse under penalty of law)

2. Say Send Keys <Control Delta> Out to add the SendKeys "^d" script (Press Ctrl+D) and simultaneously save your command. That is notably faster to create than a Dragon step-by-step macro and will also deploy faster.


Note #1: If you do not know your NATO phonetic alphabet, you can substitute by saying Send Keys <Control Dee> Out or leave out the word “Out” so that you can preview your command before saving... which is so last year


Note #2: We recommend against prefixing KnowBrainer commands with additional words like “puff” because it really shouldn't be necessary. You will occasionally experience a misfire but it shouldn't happen very often. We are continuously working on preventing accidental KnowBrainer command deployment by editing command names and in some cases, removing.


PS: We will be releasing a more complete Build of KnowBrainer on Monday so that if you choose, you can leave the word “command” out of your verbal macro building commands. However, we have to test before releasing. We will also be adding additional Open <dictation> commands like Open <System>, <Settings>, <Search> and <Run>


 



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

Forum Mission Statement
Trial Downloads
Dragon/Sales@KnowBrainer.com 
(615) 884-4558 ext 1

 02/14/2020 03:37 PM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 38667
Joined: 10/01/2006

Also note that if you would prefer to execute KnowBrainer commands from within Dragon, you can copy most KnowBrainer commands into Dragon as Advanced-Scripting commands. Dragon and KnowBrainer support the same VB language. A few KnowBrainer commands cannot be copied because we are using VB+ (our term for additional perks)



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

Forum Mission Statement
Trial Downloads
Dragon/Sales@KnowBrainer.com 
(615) 884-4558 ext 1



 02/14/2020 11:33 PM
User is offline View Users Profile Print this message

Author Icon
kkkwj
Top-Tier Member

Posts: 698
Joined: 11/05/2015

Ag, that was a great idea - a script to generate XML commands from an input file. It should be very easy for you to do that in Emacs (almost just a keyboard macro). And PG and Edgar (and maybe other people too) have seen the same need. My idea was to walk the controls and buttons and menus of an app, pull out the keybindings, and generate an XML file for Dragon (or whatever). I imagine one day that someone will write an integrated set of all these little tools to solve all the little problems in one go. But until it's worthwhile for someone to do that for sales or altruism, we'll all be stuck with homebrew solutions.

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

Win10/x64, AMD Ryzen 7 3700X, 64GB RAM, Dragon 15.3, SP 6 PRO, SpeechStart, Office 365, KB 2017, Dragon Capture, Samson Meteor USB Desk Mic, Klim and JUKSTG earbuds with microphones, 3 BenQ 2560x1440 monitors, Microsoft Sculpt Keyboard and fat mouse

 02/15/2020 11:30 AM
User is offline View Users Profile Print this message

Author Icon
Edgar
Top-Tier Member

Posts: 1109
Joined: 04/03/2009

Don't forget that many applications' menus and controls do not have direct keyboard shortcuts but do have ALT-key accelerator keys. When I write an application I ensure that all menu commands have both and that all controls (which can't have keyboard shortcuts) with text labels have accelerator keys.

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

-Edgar
DPI 15.3, 64-bit Windows 10 Pro, OpenOffice & Office 365, Norton Security, Shure X2U XLR to USB mic adapter with Audio Technica DB135 vocal mic, Asus X299-Deluxe Prime, Intel Core i9-7940X (14 core, 4.3 GHz overclocked to 4.9 GHz), G.SKILL TridentZ Series 64GB (4 x 16GB) DDR4 3333 (PC4 26600) F4-3333C16Q-64GTZ, NVIDIA GIGABYTE GeForce GTX 1060 GV-N1060G1 GAMING-6GD REV 2.0 6GB graphics card with 3 1920x1080 monitors

 02/15/2020 11:52 AM
User is offline View Users Profile Print this message

Author Icon
Mphillipson
Top-Tier Member

Posts: 259
Joined: 09/22/2014

I find creating lots and lots of scripts automatically, means inevitably you forget they exist.

 

My approach is to create them using KnowBrainer, which is quite quick anyway, as and when I need them.

 

Please see the following video as an example:

 

https://youtu.be/Z2nEz2w8DYo

 



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

Thanks Mark


 


Dragon Professional Advanced Scripting/KnowBrainer Scripts
Video Examples of Coding by Voice

 02/16/2020 03:08 PM
User is offline View Users Profile Print this message

Author Icon
PG LTU
Top-Tier Member

Posts: 2134
Joined: 03/21/2007

Agreed. That is why my utility creates an application-specific "What Can I Say" Dragon command.



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




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.

 02/18/2020 06:11 PM
User is offline View Users Profile Print this message

Author Icon
monkey8
Top-Tier Member

Posts: 3724
Joined: 01/14/2008

And why when I developed KnowBrainer I included a sidebar that tells you which commands are available for which application/window and which commands are available globally. I would certainly also endorse Mark's XML parser written specifically for the KnowBrainer XML commands file as it lays out the XML file with a very neat UI.



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



 03/15/2020 08:03 PM
User is offline View Users Profile Print this message

Author Icon
Ag
Top-Tier Member

Posts: 560
Joined: 07/08/2019

Originally posted by: monkey8 AI would certainly also endorse Mark's XML parser written specifically for the KnowBrainer XML commands file as it lays out the XML file with a very neat UI.

 

Where/what is "Mark's XML parser for the KnowBrainer XML commands..."?

 

I'm hoping that you're going to tell me it provides ways to sort and group the KnowBrainer commands. It is rather hard to see patterns in the KnowBrainer sidebar.



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

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.



 03/25/2020 02:04 PM
User is offline View Users Profile Print this message

Author Icon
Mphillipson
Top-Tier Member

Posts: 259
Joined: 09/22/2014

Please see the following link (within the solution there is a project called browse scripts)

https://github.com/Mark-Phillipson/SpeechRecognitionHelpers







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

Thanks Mark


 


Dragon Professional Advanced Scripting/KnowBrainer Scripts
Video Examples of Coding by Voice

 03/15/2020 08:01 PM
User is offline View Users Profile Print this message

Author Icon
Ag
Top-Tier Member

Posts: 560
Joined: 07/08/2019

Believe me, I create a lot of scripts using KnowBrainer. Too many. I need to generate them in order to become more consistent. I find when I create scripts by hand their names are inconsistent and I find it harder to remember them.



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

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.

 03/16/2020 12:19 AM
User is offline View Users Profile Print this message

Author Icon
dilligence
Top-Tier Member

Posts: 1298
Joined: 08/16/2010

One of the cool, sometimes lifesaving commands in browsers is:

 

re_open bar (Tab)

 

SendKeys "{Ctrl+Shift+t}"

 

I've used it so many times when either me, but mostly my girlfriend accidentally closed the entire browser

 

Well, let me know if this is useful to you.



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



 03/24/2020 11:29 PM
User is offline View Users Profile Print this message

Author Icon
kkkwj
Top-Tier Member

Posts: 698
Joined: 11/05/2015

Originally posted by: Edgar Don't forget that many applications' menus and controls do not have direct keyboard shortcuts but do have ALT-key accelerator keys. When I write an application I ensure that all menu commands have both and that all controls (which can't have keyboard shortcuts) with text labels have accelerator keys.

 

I can understand the part about giving all menu items keyboard shortcuts, but I don't understand exactly what you mean by "controls with text labels" having accelerator keys. I tried making a little Windows Form with label="N&ame" beside a textbox. When I spoke "Name", dragon did something to show the underlined _a_ in Name, but it didn't click the label. If I clicked the label it jumped into my click event handler and I could put the focus into the adjoining text box. But a click was required.

 

Is there any coding way to have Dragon force the focus (invoke an event handler) when I speak the name of a label on a form? I've tried but failed (sigh). 



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

Win10/x64, AMD Ryzen 7 3700X, 64GB RAM, Dragon 15.3, SP 6 PRO, SpeechStart, Office 365, KB 2017, Dragon Capture, Samson Meteor USB Desk Mic, Klim and JUKSTG earbuds with microphones, 3 BenQ 2560x1440 monitors, Microsoft Sculpt Keyboard and fat mouse

 03/25/2020 03:47 AM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 7499
Joined: 03/04/2007

Is there any coding way to have Dragon force the focus (invoke an event handler) when I speak the name of a label on a form? I've tried but failed (sigh).


Make sure that the textbox comes next after the label in the tab order.


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



No need to buy if all you want to do is try ...

DragonCapture KB Download (Latest)
DragonCapture Homepage

 03/25/2020 11:08 AM
User is offline View Users Profile Print this message

Author Icon
kkkwj
Top-Tier Member

Posts: 698
Joined: 11/05/2015

Wow, that worked - thank you! But I don't know _why_ it worked. First I had to put the label *in* the tab stop order, and then I aligned it in sequence as you describe. Does this mean Dragon receives my utterance, matches it to the label, and then sends a TAB command to the form to move it to the next field in TabStop order?

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

Win10/x64, AMD Ryzen 7 3700X, 64GB RAM, Dragon 15.3, SP 6 PRO, SpeechStart, Office 365, KB 2017, Dragon Capture, Samson Meteor USB Desk Mic, Klim and JUKSTG earbuds with microphones, 3 BenQ 2560x1440 monitors, Microsoft Sculpt Keyboard and fat mouse

 04/13/2020 01:29 AM
User is offline View Users Profile Print this message

Author Icon
Bingos
New Member

Posts: 3
Joined: 12/10/2018

I find creating lots and lots of scripts automatically, means inevitably you forget they exist.
 02/25/2021 11:31 PM
User is offline View Users Profile Print this message

Author Icon
Ag
Top-Tier Member

Posts: 560
Joined: 07/08/2019

well, I am quite happy with my baby steps towards creating a whole bunch of speech commands corresponding to tables of keyboard shortcuts Such as are published for nearly all apps

e.g. https://support.google.com/docs/answer/179738?hl=en#zippy=%2Cpc-shortcuts> 

Here's what I entered today, for Google Docs and Chrome (which I am being forced to use for collaborative documents, much to my disdain)

All of these commands are prefixed (by th re_wrap) function

PUFF
or
PUFF Google Docs
or
PUFF Gdocs


We will see if I remember these a year or so from now. Most of them are pretty trivial so I suspect I will. in fact, many of them are redundant, and that they may already use keyboard shortcuts common to some, many, other apps. But not all other apps, unfortunately.


complicated commands with multiple step tend to be harder to remember.

but even for these, I find that providing variants or aliases for the common cases has helped me greatly. Instead of having to remember whether it's
PUFF Insert page break
or
PUFF insert page
or
PUFF page break
or
PUFF page


I allow all of the above.



the main point of the below is that I just set up a template, and fill in fields. and that it is reasonably compact, so I can see everything close together.


it is still somewhat ugly code, e.g. I really should have an array of the command pattern regular expressions for each Keyboard shortcut, rather than having to rely on (big|Regex|alternatives). refactoring use objects state rather than long parameter lists. Cleaning that up will make things even easier to read.

But even in this quick and dirty state, it has saved me a lot of time.




cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^v", regex: re_wrap("paste with formatting") } )
cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^+v", regex: re_wrap("paste without formatting") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^z"
, regex: re_wrap("undo") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^+z"
, regex: re_wrap("redo") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "!/"
, regex: re_wrap("(Search menus?|menu search)") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^/"
, regex: re_wrap("( list)?keyboard shortcuts( list)?") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^k"
, regex: re_wrap("(insert|edit)? link") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "!{Enter}"
, regex: re_wrap("Open link") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^+f"
, regex: re_wrap("((hide|show|toggl) menus|compact mode)") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^{Enter}"
, regex: re_wrap("(insert )?page( break)?") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^y"
, regex: re_wrap("repeat( last action)?") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^b"
, regex: re_wrap("Bold") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^i"
, regex: re_wrap("italic(s|ize)?") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^u"
, regex: re_wrap("underline") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "!+5"
, regex: re_wrap("strike ?through") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^."
, regex: re_wrap(" superscript") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^,"
, regex: re_wrap(" subscript") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^!c"
, regex: re_wrap("copy text formatting") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^+v"
, regex: re_wrap("paste text formatting") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^{space}"
, regex: re_wrap("clear text formatting") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^+>"
, regex: re_wrap("(larger|increase font size)") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^<"
, regex: re_wrap("(smaller|decrease font size)") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^]"
, regex: re_wrap("indent") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^["
, regex: re_wrap("(unindent|undent)") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^!0"
, regex: re_wrap("(heading off|no heading|heading (0|zero)|normal( text)?( style)?)") } )

;; TBD: Heading speech commands - Conflict with OneNote headings
cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^!1"
, regex: re_wrap("heading (1|one)") } )
cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^!2"
, regex: re_wrap("heading (2|Two|to)") } )
cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^!3"
, regex: re_wrap("heading (3|three)") } )
cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^!4"
, regex: re_wrap("heading (4|four)") } )
cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^!5"
, regex: re_wrap("heading (5|five)") } )
cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^!6"
, regex: re_wrap("heading (6|six)") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^+l"
, regex: re_wrap("(left align|align left|justify left|left justify)") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^+r"
, regex: re_wrap("(right align|align right|Justify right|right justify)") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^+e"
, regex: re_wrap("Center( align)?") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^+j"
, regex: re_wrap("justify") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^+7"
, regex: re_wrap("numbered list") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^+8"
, regex: re_wrap("(bullets?|bullet(ed)? list)") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^+{up}"
, regex: re_wrap("move paragraph up") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^+{down}"
, regex: re_wrap("move paragraph down") } )


;;; TBD: WIP: add image and drawing commands I skipped over

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^!m"
, regex: re_wrap("(insert )?comment") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^!+a"
, regex: re_wrap("open discussion thread") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^!f"
, regex: re_wrap("insert footnote") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^+\\"
, regex: re_wrap("Context menu") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "!+f"
, regex: re_wrap("File menu") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "!+e"
, regex: re_wrap("view menu") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "!+i"
, regex: re_wrap("insert menu") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "!+o"
, regex: re_wrap("format menu") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "!+t"
, regex: re_wrap("tools menu") } )

cck_tuples.push( { context: "- Google Docs - Google Chrome"
, keys: "^+h"
, regex: re_wrap("help menu") } )

---

 

BTW the ugly indentation is largely an artifact of AutoHotKey's syntax for continuing statements across multiple lines. Combined with an incomplete emacs AHK-mode.

 

Eventually I hope to get it to  a single line per command

ctx :=  Recognizer().set_context(""- Google Docs - Google Chrome")

ctx.add(  { keys: "^+h", regex: re_wrap("help menu") } )
ctx.add(  { keys: "^+o", regex: re_wrap("format menu") } )

or

ctx.add(  [ "comment: begin"",
, [ "^+h",       "help menu" ]
, [ "^+o",       "format menu" ]
, "comment: end"  )

 always trying to make it look as close as possible to the tables one season help webpages

 

---

 

 BTW ++: I find it more pleasant to make actual running code look like the table of keyboard shortcuts and commands, then to take such a table  in a data structure like CSV and generate code. Because in the latter case when you're debugging the code you have to go back and fix the original table and then regenerate, or, if you fix a bug in the generated code, you risk losing it if you regenerate. It's like code wizards, which are a well-known  way of  quickly creating a lot of code that is hard to upgrade and maintain.

 



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

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.



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

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