~stomato463/+junk/nvdajp

« back to all changes in this revision

Viewing changes to source/appModules/calc.py

  • Committer: Masataka Shinke
  • Date: 2011-10-25 12:35:26 UTC
  • mfrom: (4185 jpmain)
  • mto: This revision was merged to the branch mainline in revision 4211.
  • Revision ID: mshinke@users.sourceforge.jp-20111025123526-ze527a2rl3z0g2ky
lp:~nishimotz/nvdajp/main : 4185 をマージ

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import _default
2
 
from keyUtils import key, sendKey
 
1
import appModuleHandler
3
2
import NVDAObjects.IAccessible
4
3
import speech
5
4
 
6
 
class AppModule(_default.AppModule):
 
5
class AppModule(appModuleHandler.AppModule):
7
6
 
8
7
        def chooseNVDAObjectOverlayClasses(self, obj, clsList):
9
8
                windowClassName=obj.windowClassName
19
18
 
20
19
        calcCommandChars=['!','=','@','#']
21
20
 
22
 
        calcCommandKeys=[
23
 
                "back","escape","ExtendedReturn","Return",
24
 
                "f2","f3","f4","f5","f6","f7","f8","f9",
25
 
                "l","n","o","p","r","s","t",
26
 
        ]
 
21
        calcCommandGestures=(
 
22
                "kb:back","kb:escape","kb:enter","kb:numpadEnter",
 
23
                "kb:f2","kb:f3","kb:f4","kb:f5","kb:f6","kb:f7","kb:f8","kb:f9",
 
24
                "kb:l","kb:n","kb:o","kb:p","kb:r","kb:s","kb:t",
 
25
        )
27
26
 
28
27
        def _get_name(self):
29
28
                name=super(Display,self).name
36
35
                if ch in self.calcCommandChars:
37
36
                        speech.speakObjectProperties(self,value=True)
38
37
 
39
 
        def script_executeAndRead(self,keyPress):
40
 
                sendKey(keyPress)
 
38
        def script_executeAndRead(self,gesture):
 
39
                gesture.send()
41
40
                speech.speakObjectProperties(self,value=True)
42
41
 
43
 
for k in Display.calcCommandKeys:
44
 
        Display.bindKey(k,"executeAndRead")
 
42
        def initOverlayClass(self):
 
43
                for g in Display.calcCommandGestures:
 
44
                        self.bindGesture(g,"executeAndRead")