Add super key support for thumb shift mode#46
Conversation
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds IBus.ModifierType.MOD4_MASK to the state mask and modifier checks in both the Python 2 and Python 3 engines. The feedback suggests removing redundant backslashes (\) used for line continuation inside parentheses in the Python 3 engine to comply with PEP 8 and maintain consistency with the Python 2 implementation.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| (IBus.ModifierType.CONTROL_MASK | \ | ||
| IBus.ModifierType.MOD1_MASK | \ | ||
| IBus.ModifierType.MOD4_MASK) == 0: |
There was a problem hiding this comment.
In Python, backslashes (\) for line continuation are redundant and discouraged when inside parentheses, as Python implicitly continues lines within parentheses, brackets, and braces (see PEP 8). Removing them also makes the code consistent with the Python 2 engine implementation in engine/python2/engine.py.
| (IBus.ModifierType.CONTROL_MASK | \ | |
| IBus.ModifierType.MOD1_MASK | \ | |
| IBus.ModifierType.MOD4_MASK) == 0: | |
| (IBus.ModifierType.CONTROL_MASK | | |
| IBus.ModifierType.MOD1_MASK | | |
| IBus.ModifierType.MOD4_MASK) == 0: |
Symptom
Given that:
When a user presses Super + Space
Then the user sees a space added to the text field and layout not switched
Expected
Given that:
When a user presses Super + Space
Then the user sees that Anthy is no longer the active IBus Engine
Root Cause
The super key modifier is ignored only in thumb shift mode.
In Thumb Shift Mode (
__process_key_event_thumb()):In Romaji or Kana Mode (
__process_key_event_internal2()):Solution
Supplement
MOD4_MASKto the state usages specific to thumb shift mode.Remarks
Please let me know if there are practices that I should follow.