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

Method onKeyUp

python/input_methods/chewing/chewing_ime.py:718–734  ·  view source on GitHub ↗
(self, keyEvent)

Source from the content-addressed store, hash-verified

716 return False
717
718 def onKeyUp(self, keyEvent):
719 pressedDuration = time.time() - self.lastKeyDownTime
720 if pressedDuration < 0.5 and self.isComposing() and not self.chewingContext.bopomofo_Check():
721 if self.lastKeyEvent:
722 if self.lastKeyEvent.isKeyDown(VK_RSHIFT) and self.compositionCursor < len(self.compositionString):
723 self.chewingContext.handle_Right()
724 self.setCompositionCursor(
725 self.chewingContext.cursor_Current())
726 if self.lastKeyEvent.isKeyDown(VK_LSHIFT) and self.compositionCursor > 0:
727 self.chewingContext.handle_Left()
728 self.setCompositionCursor(
729 self.chewingContext.cursor_Current())
730
731 self.lastKeyDownTime = 0.0
732 return True
733 else:
734 return False
735
736 def onPreservedKey(self, guid):
737 self.lastKeyEvent = None

Callers

nothing calls this directly

Calls 4

timeMethod · 0.80
isComposingMethod · 0.80
isKeyDownMethod · 0.80
setCompositionCursorMethod · 0.80

Tested by

no test coverage detected