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

Method onKeyDown

python/input_methods/chearray/chearray_ime.py:94–109  ·  view source on GitHub ↗
(self, keyEvent)

Source from the content-addressed store, hash-verified

92
93
94 def onKeyDown(self, keyEvent):
95 if self.cfg.selCinType == 0 or self.cfg.selCinType == 2:
96 self.maxCharLength = 5
97 else:
98 self.maxCharLength = 4
99
100 if self.cfg.selCinType == 1 and self.compositionChar == 'w' and self.cinbase.isNumberChar(keyEvent.keyCode):
101 if self.cin.isInCharDef('w' + chr(keyEvent.charCode)):
102 self.compositionChar += chr(keyEvent.charCode)
103 self.setCompositionString(self.compositionString + chr(keyEvent.charCode))
104 self.setCompositionCursor(len(self.compositionString))
105 self.canUseNumberKey = False
106
107 KeyState = self.cinbase.onKeyDown(self, keyEvent, CinTable, RCinTable, HCinTable)
108 self.canUseNumberKey = True
109 return KeyState
110
111
112 # 使用者放開按鍵,在 app 收到前先過濾那些鍵是輸入法需要的。

Callers

nothing calls this directly

Calls 4

isNumberCharMethod · 0.80
setCompositionStringMethod · 0.80
setCompositionCursorMethod · 0.80
isInCharDefMethod · 0.45

Tested by

no test coverage detected