1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ash/wm/cursor_manager_chromeos.h"
7 #include "base/logging.h"
8 #include "ui/keyboard/keyboard_util.h"
9 #include "ui/wm/core/cursor_manager.h"
10 #include "ui/wm/core/native_cursor_manager.h"
14 CursorManager::CursorManager(
15 scoped_ptr
< ::wm::NativeCursorManager
> delegate
)
16 : ::wm::CursorManager(delegate
.Pass()) {
19 CursorManager::~CursorManager() {
22 bool CursorManager::ShouldHideCursorOnKeyEvent(
23 const ui::KeyEvent
& event
) const {
24 // Clicking on a key when the accessibility virtual keyboard is enabled should
25 // not hide the cursor.
26 if (keyboard::GetAccessibilityKeyboardEnabled())
28 // All alt and control key commands are ignored.
29 if (event
.IsAltDown() || event
.IsControlDown())
32 ui::KeyboardCode code
= event
.key_code();
33 if (code
>= ui::VKEY_F1
&& code
<= ui::VKEY_F24
)
35 if (code
>= ui::VKEY_BROWSER_BACK
&& code
<= ui::VKEY_MEDIA_LAUNCH_APP2
)
40 case ui::VKEY_CONTROL
:
42 // Search key == VKEY_LWIN.
46 case ui::VKEY_BRIGHTNESS_DOWN
:
47 case ui::VKEY_BRIGHTNESS_UP
:
48 case ui::VKEY_KBD_BRIGHTNESS_UP
:
49 case ui::VKEY_KBD_BRIGHTNESS_DOWN
: