-
Notifications
You must be signed in to change notification settings - Fork 0
/
teams.py
41 lines (34 loc) · 1.1 KB
/
teams.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
2#imports the library
from dragonfly import (Function, Grammar, AppContext, MappingRule, Integer, Key, Text, Dictation, Choice, Pause, Mouse)
def calculateSlotNumber(number):
startingPoint = .20
increment = .05
calculation = (number*increment)
slotNumber = (startingPoint + calculation) - increment
Mouse("(0.1, {}), left".format(slotNumber)).execute()
class CodeMappings(MappingRule):
mapping = {
'tab <number>': Function(calculateSlotNumber),
'Activity': Key('c-1'),
'chat': Key('c-2'),
'Teams': Key('c-3'),
'Calendar': Key('c-4'),
'snurch': Key('c-e'),
'goat': Key('c-g'),
'Filter': Key('cs-f'),
'make call': Key('cs-c') + Key('csa-slash'),
# '<text>': Text("%(text)s "),
}
extras=[
Integer('tab', 1, 10),
Integer('number', 1, 9999),
Dictation("text")
]
context = AppContext(executable='Teams')
grammar=Grammar('Teams',context=context)
grammar.add_rule(CodeMappings())
grammar.load()
def unload():
global grammar
if grammar: grammar.unload()
grammar = None