keyboard_util.h 829 B

1234567891011121314151617181920212223242526272829
  1. // Copyright (c) 2019 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.
  4. #ifndef ASH_KEYBOARD_KEYBOARD_UTIL_H_
  5. #define ASH_KEYBOARD_KEYBOARD_UTIL_H_
  6. #include "ash/ash_export.h"
  7. #include "ui/events/keycodes/keyboard_codes.h"
  8. namespace ash {
  9. namespace keyboard_util {
  10. // Returns whether the given key code corresponds to one of the 4 arrow keys.
  11. ASH_EXPORT bool IsArrowKeyCode(const ui::KeyboardCode key_code);
  12. // Closes the active (Chrome OS or Android VK). Returns false if no keyboard was
  13. // active.
  14. // TODO(crbug.com/1060272): Move this to KeyboardControllerImpl once that class
  15. // handles both VKs.
  16. bool CloseKeyboardIfActive();
  17. } // namespace keyboard_util
  18. } // namespace ash
  19. #endif // ASH_KEYBOARD_KEYBOARD_UTIL_H_