-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshow_menu.py
More file actions
41 lines (34 loc) · 1.16 KB
/
show_menu.py
File metadata and controls
41 lines (34 loc) · 1.16 KB
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
#
# Python Macro Language for Dragon NaturallySpeaking
# nextApp
#
import natlink
from natlinkutils import *
class ThisGrammar(GrammarBase):
gramSpec = """
<start> exported = show menu;
"""
def gotResults_start(self,words,fullResults):
# execute a control-left drag down 30 pixels
#x,y = natlink.getCursorPos()
natlink.playString('{F10}',0x01)
'''
natlink.playEvents( [ (wm_syskeydown,0x12,1),
(wm_keydown,0x09,1),
(wm_keyup,0x09,1),#(wm_lbuttondown,x,y),
(wm_keydown,0x09,1),
(wm_keyup,0x09,1),#(wm_lbuttondown,x,y),
#(wm_mousemove,x,y+30),
#(wm_lbuttonup,x,y+30),
(wm_syskeyup,0x12,1)
] )
'''
def initialize(self):
self.load(self.gramSpec)
self.activateAll()
thisGrammar = ThisGrammar()
thisGrammar.initialize()
def unload():
global thisGrammar
if thisGrammar: thisGrammar.unload()
thisGrammar = None