Skip to content

Commit 46e3bba

Browse files
Defer Windows arrow key and delete handling (#22207)
The framework handles arrow keys, delete, and backspace (and with better unicode support), so we shouldn't handle them at the embedding level. Fixes #69202
1 parent eea98b2 commit 46e3bba

File tree

1 file changed

+2
-28
lines changed

1 file changed

+2
-28
lines changed

shell/platform/windows/text_input_plugin.cc

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -61,35 +61,9 @@ void TextInputPlugin::KeyboardHook(FlutterWindowsView* view,
6161
return;
6262
}
6363
if (action == WM_KEYDOWN) {
64+
// Most editing keys (arrow keys, backspace, delete, etc.) are handled in
65+
// the framework, so don't need to be handled at this layer.
6466
switch (key) {
65-
case VK_LEFT:
66-
if (active_model_->MoveCursorBack()) {
67-
SendStateUpdate(*active_model_);
68-
}
69-
break;
70-
case VK_RIGHT:
71-
if (active_model_->MoveCursorForward()) {
72-
SendStateUpdate(*active_model_);
73-
}
74-
break;
75-
case VK_END:
76-
active_model_->MoveCursorToEnd();
77-
SendStateUpdate(*active_model_);
78-
break;
79-
case VK_HOME:
80-
active_model_->MoveCursorToBeginning();
81-
SendStateUpdate(*active_model_);
82-
break;
83-
case VK_BACK:
84-
if (active_model_->Backspace()) {
85-
SendStateUpdate(*active_model_);
86-
}
87-
break;
88-
case VK_DELETE:
89-
if (active_model_->Delete()) {
90-
SendStateUpdate(*active_model_);
91-
}
92-
break;
9367
case VK_RETURN:
9468
EnterPressed(active_model_.get());
9569
break;

0 commit comments

Comments
 (0)