From 9def2f93713636e9b4e872da103f8870a76c63f5 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Mon, 2 Nov 2020 11:09:03 -0800 Subject: [PATCH] Defer Windows arrow key and delete handling (flutter/engine#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 --- .../platform/windows/text_input_plugin.cc | 30 ++----------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/engine/src/flutter/shell/platform/windows/text_input_plugin.cc b/engine/src/flutter/shell/platform/windows/text_input_plugin.cc index e69caf504e..ebfe004292 100644 --- a/engine/src/flutter/shell/platform/windows/text_input_plugin.cc +++ b/engine/src/flutter/shell/platform/windows/text_input_plugin.cc @@ -61,35 +61,9 @@ void TextInputPlugin::KeyboardHook(FlutterWindowsView* view, return; } if (action == WM_KEYDOWN) { + // Most editing keys (arrow keys, backspace, delete, etc.) are handled in + // the framework, so don't need to be handled at this layer. switch (key) { - case VK_LEFT: - if (active_model_->MoveCursorBack()) { - SendStateUpdate(*active_model_); - } - break; - case VK_RIGHT: - if (active_model_->MoveCursorForward()) { - SendStateUpdate(*active_model_); - } - break; - case VK_END: - active_model_->MoveCursorToEnd(); - SendStateUpdate(*active_model_); - break; - case VK_HOME: - active_model_->MoveCursorToBeginning(); - SendStateUpdate(*active_model_); - break; - case VK_BACK: - if (active_model_->Backspace()) { - SendStateUpdate(*active_model_); - } - break; - case VK_DELETE: - if (active_model_->Delete()) { - SendStateUpdate(*active_model_); - } - break; case VK_RETURN: EnterPressed(active_model_.get()); break;