Revert 161386 - Ignore certain keys when hiding the cursor

BUG=153157
Test=Visual

Review URL: https://codereview.chromium.org/11087064

TBR=davemoore@chromium.org
Review URL: https://codereview.chromium.org/11094088

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161398 0039d316-1c4b-4281-b951-d872f2087c98
parent 79b64cf4
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include "ui/aura/shared/compound_event_filter.h" #include "ui/aura/shared/compound_event_filter.h"
#include "base/hash_tables.h"
#include "ui/aura/client/activation_client.h" #include "ui/aura/client/activation_client.h"
#include "ui/aura/client/cursor_client.h" #include "ui/aura/client/cursor_client.h"
#include "ui/aura/client/drag_drop_client.h" #include "ui/aura/client/drag_drop_client.h"
...@@ -33,50 +32,6 @@ Window* GetActiveWindow(Window* window) { ...@@ -33,50 +32,6 @@ Window* GetActiveWindow(Window* window) {
GetActiveWindow(); GetActiveWindow();
} }
bool ShouldHideCursorOnKeyEvent(const ui::KeyEvent& event) {
// All alt and control key commands are ignored.
if (event.IsAltDown() || event.IsControlDown())
return false;
static bool inited = false;
static base::hash_set<int32> ignored_keys;
if (!inited) {
// Modifiers.
ignored_keys.insert(ui::VKEY_SHIFT);
ignored_keys.insert(ui::VKEY_CONTROL);
ignored_keys.insert(ui::VKEY_MENU);
// Search key == VKEY_LWIN.
ignored_keys.insert(ui::VKEY_LWIN);
// Function keys.
for (int key = ui::VKEY_F1; key <= ui::VKEY_F24; ++key)
ignored_keys.insert(key);
// Media keys.
for (int key = ui::VKEY_BROWSER_BACK; key <= ui::VKEY_MEDIA_LAUNCH_APP2;
++key) {
ignored_keys.insert(key);
}
ignored_keys.insert(ui::VKEY_WLAN);
ignored_keys.insert(ui::VKEY_BRIGHTNESS_DOWN);
ignored_keys.insert(ui::VKEY_BRIGHTNESS_UP);
ignored_keys.insert(ui::VKEY_KBD_BRIGHTNESS_DOWN);
ignored_keys.insert(ui::VKEY_KBD_BRIGHTNESS_UP);
#if defined(OS_POSIX)
ignored_keys.insert(ui::VKEY_POWER);
#endif
inited = true;
}
if (ignored_keys.count(event.key_code()) > 0)
return false;
return true;
}
} // namespace } // namespace
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
...@@ -209,11 +164,8 @@ void CompoundEventFilter::SetCursorVisibilityOnEvent(aura::Window* target, ...@@ -209,11 +164,8 @@ void CompoundEventFilter::SetCursorVisibilityOnEvent(aura::Window* target,
// CompoundEventFilter, ui::EventHandler implementation: // CompoundEventFilter, ui::EventHandler implementation:
ui::EventResult CompoundEventFilter::OnKeyEvent(ui::KeyEvent* event) { ui::EventResult CompoundEventFilter::OnKeyEvent(ui::KeyEvent* event) {
if (ShouldHideCursorOnKeyEvent(*event)) { SetCursorVisibilityOnEvent(
SetCursorVisibilityOnEvent( static_cast<Window*>(event->target()), event, false);
static_cast<Window*>(event->target()), event, false);
}
return FilterKeyEvent(event); return FilterKeyEvent(event);
} }
......
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