Added save file command
parent
d9c822f4d7
commit
5d513dc1a1
|
@ -18,12 +18,12 @@ class UsefulStuff(MappingRule):
|
||||||
"arrow": Text("->"),
|
"arrow": Text("->"),
|
||||||
"double arrow": Text("=>"),
|
"double arrow": Text("=>"),
|
||||||
"enter|slap": Key("enter"),
|
"enter|slap": Key("enter"),
|
||||||
|
"spank": Key("space"),
|
||||||
"east": Key("end"),
|
"east": Key("end"),
|
||||||
"west": Key("home"),
|
"west": Key("home"),
|
||||||
"format": Key("ctrl") + Key("alt") + Key("f"),
|
"format": Key("ctrl") + Key("alt") + Key("f"),
|
||||||
"save file": Key("ctrl") + Key("s"),
|
"hash": Text("#"),
|
||||||
"hash": Key("#"),
|
"punch": Text(","),
|
||||||
"punch": Key(","),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
globalStuff = Grammar("useful custom global commands") # Create a grammar to contain the command rule.
|
globalStuff = Grammar("useful custom global commands") # Create a grammar to contain the command rule.
|
||||||
|
|
|
@ -113,6 +113,7 @@ config.cmd.map = Item(
|
||||||
"paste": release + Key("c-v"),
|
"paste": release + Key("c-v"),
|
||||||
"scratch": release + Key("c-z"),
|
"scratch": release + Key("c-z"),
|
||||||
"no scratch": release + Key("c-y"),
|
"no scratch": release + Key("c-y"),
|
||||||
|
"save file": release + Key("c-s"),
|
||||||
"duplicate <n>": release + Key("c-c, c-v:%(n)d"),
|
"duplicate <n>": release + Key("c-c, c-v:%(n)d"),
|
||||||
"copy": release + Key("c-c"),
|
"copy": release + Key("c-c"),
|
||||||
"cut": release + Key("c-x"),
|
"cut": release + Key("c-x"),
|
||||||
|
|
|
@ -40,6 +40,14 @@ def caps_first_format(command): # Callback when command is spoken.
|
||||||
printer = Text(upperString)
|
printer = Text(upperString)
|
||||||
printer.execute()
|
printer.execute()
|
||||||
|
|
||||||
|
# Voice command rule for first caracter of the first word.
|
||||||
|
def dictate_format(command): # Callback when command is spoken.
|
||||||
|
textToPrint = command
|
||||||
|
someString = str(textToPrint)
|
||||||
|
upperString = someString.capitalize()
|
||||||
|
printer = Text(upperString)
|
||||||
|
printer.execute()
|
||||||
|
|
||||||
# Voice command rule for "middle_underscores" naming convention.
|
# Voice command rule for "middle_underscores" naming convention.
|
||||||
def middle_underscores(command): # Callback when command is spoken.
|
def middle_underscores(command): # Callback when command is spoken.
|
||||||
textToPrint = command
|
textToPrint = command
|
||||||
|
@ -111,6 +119,11 @@ class ProgrammingNamingConventions(MappingRule):
|
||||||
"caps first <command> <symbol>": Function(caps_first_format) + Text("%(symbol)s"),
|
"caps first <command> <symbol>": Function(caps_first_format) + Text("%(symbol)s"),
|
||||||
"<symbol> caps first <command>": Text("%(symbol)s") + Function(caps_first_format),
|
"<symbol> caps first <command>": Text("%(symbol)s") + Function(caps_first_format),
|
||||||
|
|
||||||
|
#this command capitalizes the 1st letter of first word example: Test value
|
||||||
|
"dictate <command>": Function(dictate_format),
|
||||||
|
"dictate <command> <symbol>": Function(dictate_format) + Text("%(symbol)s"),
|
||||||
|
"<symbol> dictate <command>": Text("%(symbol)s") + Function(dictate_format),
|
||||||
|
|
||||||
#this command capitalizes the 1st letter of each word and removes spaces example: TestValue
|
#this command capitalizes the 1st letter of each word and removes spaces example: TestValue
|
||||||
"camel <command>": Function(camel_format),
|
"camel <command>": Function(camel_format),
|
||||||
"camel <command> <symbol>": Function(camel_format) + Text("%(symbol)s"),
|
"camel <command> <symbol>": Function(camel_format) + Text("%(symbol)s"),
|
||||||
|
|
Loading…
Reference in New Issue