keyboard_util.h 835 B

12345678910111213141516171819202122232425262728
  1. // Copyright (c) 2015 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef SHELL_COMMON_KEYBOARD_UTIL_H_
  5. #define SHELL_COMMON_KEYBOARD_UTIL_H_
  6. #include <string>
  7. #include "base/strings/string16.h"
  8. #include "ui/events/keycodes/keyboard_codes.h"
  9. namespace electron {
  10. // Return key code of the char, and also determine whether the SHIFT key is
  11. // pressed.
  12. ui::KeyboardCode KeyboardCodeFromCharCode(base::char16 c, bool* shifted);
  13. // Return key code of the |str|, and also determine whether the SHIFT key is
  14. // pressed.
  15. ui::KeyboardCode KeyboardCodeFromStr(const std::string& str, bool* shifted);
  16. // Ported from ui/events/blink/blink_event_util.h
  17. int WebEventModifiersToEventFlags(int modifiers);
  18. } // namespace electron
  19. #endif // SHELL_COMMON_KEYBOARD_UTIL_H_