Skip to content

Commit dd4fa87

Browse files
committed
Fix non-letter key input in tcore mode
The TIZEN_CORE_WL_EVENT_KEY_DOWN/UP listeners in TizenWindowTcoreWl::RegisterEventHandlers were passing the wrong strings into view_delegate_->OnKey(), so punctuation keys (period, minus, equal, etc.) silently dropped when the IME panel was hidden. OnKey's signature is (key, string, compose, ...) where 'string' is expected to be the printable character produced by the key. TextInputChannel::HandleKey relies on `strlen(string) == 1 && IsAsciiPrintableKey(string[0])` to forward the character to the active TextInputModel. The ecore_wl2 handler maps: key <- key_event->key (XKB symbol, e.g. "period") string <- key_event->string (composed char, e.g. ".") compose <- key_event->compose The tcore handler was passing: key <- keyname (key name, often == keysymbol) string <- keysymbol (XKB symbol "period", strlen != 1) compose <- compose For alphanumeric keys keysymbol is a single character ("a", "1"), so the fallback in HandleKey() happened to fire. For punctuation keys keysymbol is the symbol name ("period", "minus", "equal"), strlen > 1, and the printable-fallback branch is skipped, so nothing ever reaches the engine. Pass keysymbol as 'key' and compose (the composed UTF-8 result) as 'string', matching the ecore_wl2 contract. The IME path keeps working independently because tizen_core_imf_context_filter_event does its own keysym -> UTF-8 translation internally.
1 parent c5cdbeb commit dd4fa87

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

flutter/shell/platform/tizen/tizen_window_tcore_wl.cc

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,15 @@ void TizenWindowTcoreWl::RegisterEventHandlers() {
674674
self->input_method_context_->HandleTcoreWlEventKey(event, true);
675675
}
676676
if (!handled) {
677-
self->view_delegate_->OnKey(keyname, keysymbol, compose, modifiers,
677+
// Match TizenWindowEcoreWl2 OnKey arg semantics:
678+
// param 1 (key) = XKB key symbol name (e.g. "period")
679+
// param 2 (string) = composed printable string (e.g. ".")
680+
// tcore's keysymbol corresponds to ecore's key_event->key, and
681+
// tcore's compose corresponds to ecore's key_event->string.
682+
// Passing keysymbol as `string` breaks the printable-key fallback
683+
// in TextInputChannel::HandleKey() for keys whose symbol name is
684+
// multi-char ("period", "minus", "equal", ...).
685+
self->view_delegate_->OnKey(keysymbol, compose, compose, modifiers,
678686
keycode, dev_identifier, true);
679687
}
680688
free(keyname);
@@ -718,7 +726,8 @@ void TizenWindowTcoreWl::RegisterEventHandlers() {
718726
self->input_method_context_->HandleTcoreWlEventKey(event, false);
719727
}
720728
if (!handled) {
721-
self->view_delegate_->OnKey(keyname, keysymbol, compose, modifiers,
729+
// See key-down handler for the keysymbol vs compose rationale.
730+
self->view_delegate_->OnKey(keysymbol, compose, compose, modifiers,
722731
keycode, nullptr, false);
723732
}
724733
free(keyname);

0 commit comments

Comments
 (0)