Skip to content

Filter hardware keyboard keys through IMF for Hangul input#178

Open
JSUYA wants to merge 1 commit into
flutter-tizen:masterfrom
JSUYA:fix-keyboard-behavior
Open

Filter hardware keyboard keys through IMF for Hangul input#178
JSUYA wants to merge 1 commit into
flutter-tizen:masterfrom
JSUYA:fix-keyboard-behavior

Conversation

@JSUYA

@JSUYA JSUYA commented Jun 12, 2026

Copy link
Copy Markdown
Member

With a hardware keyboard the input panel is usually hidden and key events never reached the IMF, so the Hangul/English toggle key was ignored and Hangul composition was impossible. Route key events through the IMF whenever a text field is being edited, regardless of panel visibility. Navigation and system keys (direction keys, Return, Select, XF86 keys) still bypass the IMF when the panel is hidden so app navigation and TV remote control keep working.

#173

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors Tizen text input handling by replacing assertions with null-pointer checks on the IMF context, managing the active editing state, and introducing key filtering via ShouldFilterKey to exclude navigation and system keys. It also updates the IMF context reset logic to occur conditionally. Review feedback recommends simplifying a TextRange comparison using the inequality operator and declaring the static array of navigation keys as constexpr.

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.

Comment thread flutter/shell/platform/tizen/channels/text_input_channel.cc
Comment thread flutter/shell/platform/tizen/tizen_input_method_context.cc
@JSUYA JSUYA force-pushed the fix-keyboard-behavior branch from a3c0b85 to c41dd7f Compare June 15, 2026 01:29
When a hardware keyboard is connected, the input panel is usually not
shown, and key events were never routed to the IMF. As a result, the
Hangul/English toggle key was ignored and Hangul composition was
impossible.

Now key events are filtered through the IMF while a text field is being
edited, even when the input panel is hidden. Behavior while the panel
is shown is unchanged. Navigation and system keys (direction keys,
Return, Select, XF86 keys) always bypass the IMF when the panel is
hidden so that app navigation and TV remote control keep working.
A TextInputType.none client keeps the IMF context focused with the
panel disabled, so it also accepts hardware keyboard composition
without showing the on-screen keyboard.

Also hardens the surrounding IMF handling:

- TextInput.setClient resets the IMF context so that a composition
  pending from the previous client cannot leak into the new client.
- TextInput.setEditingState resets the IMF context only when the new
  state differs from the current model, so a state echoed back by the
  framework no longer cancels an ongoing composition.
- All TizenInputMethodContext methods are guarded against a null
  imf_context_ (e.g. on images without an ISE).
- The input panel is treated as shown during the WILL_SHOW transition
  so that keys arriving mid-transition are not misjudged as
  hidden-path input.
- Ecore_Event_Key in HandleNuiKeyEvent is zero-initialized; its compose
  and dev members were read uninitialized when converting to an
  Ecore_IMF event.
@JSUYA JSUYA force-pushed the fix-keyboard-behavior branch from c41dd7f to 53ae034 Compare June 15, 2026 06:49
@JSUYA JSUYA self-assigned this Jun 16, 2026
@JSUYA JSUYA added the enhancement New feature or request label Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant