MCPcopy Create free account
hub / github.com/EasyIME/PIME / KeyEvent

Class KeyEvent

python/textService.py:36–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34COMMAND_MENU = 2
35
36class KeyEvent:
37 def __init__(self, msg):
38 self.charCode = msg["charCode"]
39 self.keyCode = msg["keyCode"]
40 self.repeatCount = msg["repeatCount"]
41 self.scanCode = msg["scanCode"]
42 self.isExtended = msg["isExtended"]
43 self.keyStates = msg["keyStates"]
44
45 def isKeyDown(self, code):
46 return (self.keyStates[code] & (1 << 7)) != 0
47
48 def isKeyToggled(self, code):
49 return (self.keyStates[code] & 1) != 0
50
51 def isChar(self):
52 return (self.charCode != 0)
53
54 def isPrintableChar(self):
55 return self.charCode > 0x1f and self.charCode != 0x7f
56
57 def isSymbols(self):
58 return self.charCode in [0x3d, 0x5b, 0x5c, 0x5d, 0x27]
59
60
61class TextService:

Callers 1

handleRequestMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected