summaryrefslogtreecommitdiff
path: root/chromium/ui/events/event.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-10-26 13:57:00 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-11-02 11:31:01 +0000
commit1943b3c2a1dcee36c233724fc4ee7613d71b9cf6 (patch)
tree8c1b5f12357025c197da5427ae02cfdc2f3570d6 /chromium/ui/events/event.cc
parent21ba0c5d4bf8fba15dddd97cd693bad2358b77fd (diff)
downloadqtwebengine-chromium-1943b3c2a1dcee36c233724fc4ee7613d71b9cf6.tar.gz
BASELINE: Update Chromium to 94.0.4606.111
Change-Id: I924781584def20fc800bedf6ff41fdb96c438193 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/ui/events/event.cc')
-rw-r--r--chromium/ui/events/event.cc18
1 files changed, 16 insertions, 2 deletions
diff --git a/chromium/ui/events/event.cc b/chromium/ui/events/event.cc
index b55d5ba508f..f3a4105f02b 100644
--- a/chromium/ui/events/event.cc
+++ b/chromium/ui/events/event.cc
@@ -909,6 +909,20 @@ KeyEvent& KeyEvent::operator=(const KeyEvent& rhs) {
KeyEvent::~KeyEvent() = default;
+// static
+// For compatibility, this is enabled by default.
+bool KeyEvent::synthesize_key_repeat_enabled_ = true;
+
+// static
+bool KeyEvent::IsSynthesizeKeyRepeatEnabled() {
+ return synthesize_key_repeat_enabled_;
+}
+
+// static
+void KeyEvent::SetSynthesizeKeyRepeatEnabled(bool enabled) {
+ synthesize_key_repeat_enabled_ = enabled;
+}
+
void KeyEvent::InitializeNative() {
latency()->AddLatencyNumberWithTimestamp(
INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, time_stamp());
@@ -916,7 +930,7 @@ void KeyEvent::InitializeNative() {
// Check if this is a key repeat. This must be called before initial flags
// processing, e.g: NormalizeFlags(), to avoid issues like crbug.com/1069690.
- if (IsRepeated(GetLastKeyEvent()))
+ if (synthesize_key_repeat_enabled_ && IsRepeated(GetLastKeyEvent()))
set_flags(flags() | EF_IS_REPEAT);
#if defined(USE_X11)
@@ -1057,7 +1071,7 @@ char16_t KeyEvent::GetCharacter() const {
// Historically ui::KeyEvent has held only BMP characters.
// Until this explicitly changes, require |key_| to hold a BMP character.
DomKey::Base utf32_character = key_.ToCharacter();
- char16_t ucs2_character{utf32_character};
+ char16_t ucs2_character = static_cast<char16_t>(utf32_character);
DCHECK_EQ(static_cast<DomKey::Base>(ucs2_character), utf32_character);
// Check if the control character is down. Note that ALTGR is represented
// on Windows as CTRL|ALT, so we need to make sure that is not set.