2019-08-02 15:25:33 -05:00
|
|
|
# Author:Brandon Lovrien
|
2022-02-10 07:19:17 -06:00
|
|
|
# Modified Jeremy Hayes
|
2019-08-02 15:25:33 -05:00
|
|
|
# This script includes some commands for various useful symbols used in programming
|
|
|
|
|
2019-08-07 14:32:51 -05:00
|
|
|
#from dragonfly import (Grammar, CompoundRule, Dictation, Text, Key, AppContext, MappingRule)
|
|
|
|
from dragonfly import *
|
2019-08-02 15:25:33 -05:00
|
|
|
# Useful commands for encapsulation of quotes, etc.
|
|
|
|
class UsefulStuff(MappingRule):
|
|
|
|
|
|
|
|
mapping = {
|
|
|
|
"in quotes": Text("\"\"") + Key("left"),
|
|
|
|
"in single quotes": Text("\'\'") + Key("left"),
|
|
|
|
"in parentheses": Text("()") + Key("left"),
|
|
|
|
"in brackets": Text("[]") + Key("left"),
|
|
|
|
"in braces": Text("{}") + Key("left"),
|
|
|
|
"in angle brackets": Text("<>") + Key("left"),
|
|
|
|
"parameters": Text("()"),
|
|
|
|
"arrow": Text("->"),
|
2019-08-07 14:32:51 -05:00
|
|
|
"double arrow": Text("=>"),
|
|
|
|
"enter|slap": Key("enter"),
|
2022-02-10 09:47:18 -06:00
|
|
|
"spank": Key("space"),
|
2019-08-07 14:32:51 -05:00
|
|
|
"east": Key("end"),
|
|
|
|
"west": Key("home"),
|
2022-02-10 07:19:17 -06:00
|
|
|
"format": Key("ctrl") + Key("alt") + Key("f"),
|
2022-02-10 09:47:18 -06:00
|
|
|
"hash": Text("#"),
|
|
|
|
"punch": Text(","),
|
2019-08-02 15:25:33 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
globalStuff = Grammar("useful custom global commands") # Create a grammar to contain the command rule.
|
|
|
|
globalStuff.add_rule(UsefulStuff())
|
2019-08-07 14:32:51 -05:00
|
|
|
globalStuff.load()
|