Commit 1addcee1 authored by David Reveman's avatar David Reveman Committed by Commit Bot

exo: Ignore synthetic key repeat events.

Exo clients should not see these events and instead handle
key repeat on the client side.

Bug: 847500
Test: exo_unittests
Change-Id: I4d4c755dbe0a2fffe24f3ce85fd70a3608cfed7c
Reviewed-on: https://chromium-review.googlesource.com/1079768Reviewed-by: default avatarDaniele Castagna <dcastagna@chromium.org>
Commit-Queue: David Reveman <reveman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563095}
parent 1f1be07a
...@@ -217,6 +217,10 @@ void Keyboard::OnKeyEvent(ui::KeyEvent* event) { ...@@ -217,6 +217,10 @@ void Keyboard::OnKeyEvent(ui::KeyEvent* event) {
if (!focus_) if (!focus_)
return; return;
// Ignore synthetic key repeat events.
if (event->is_repeat())
return;
// Process reserved accelerators before sending it to client. // Process reserved accelerators before sending it to client.
if (ProcessAcceleratorIfReserved(focus_, event)) { if (ProcessAcceleratorIfReserved(focus_, event)) {
// Discard a key press event if it's a reserved accelerator and it's // Discard a key press event if it's a reserved accelerator and it's
......
...@@ -107,6 +107,9 @@ void Seat::OnWindowFocused(aura::Window* gained_focus, ...@@ -107,6 +107,9 @@ void Seat::OnWindowFocused(aura::Window* gained_focus,
// ui::EventHandler overrides: // ui::EventHandler overrides:
void Seat::OnKeyEvent(ui::KeyEvent* event) { void Seat::OnKeyEvent(ui::KeyEvent* event) {
// Ignore synthetic key repeat events.
if (event->is_repeat())
return;
switch (event->type()) { switch (event->type()) {
case ui::ET_KEY_PRESSED: case ui::ET_KEY_PRESSED:
pressed_keys_.insert(event->code()); pressed_keys_.insert(event->code());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment