keyboard_util.h 750 B

12345678910111213141516171819202122
  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 ELECTRON_SHELL_COMMON_KEYBOARD_UTIL_H_
  5. #define ELECTRON_SHELL_COMMON_KEYBOARD_UTIL_H_
  6. #include "base/strings/string_piece.h"
  7. #include "third_party/abseil-cpp/absl/types/optional.h"
  8. #include "ui/events/keycodes/keyboard_codes.h"
  9. namespace electron {
  10. // Return key code of the |str|, if the original key is a shifted character,
  11. // for example + and /, set it in |shifted_char|.
  12. // pressed.
  13. ui::KeyboardCode KeyboardCodeFromStr(base::StringPiece str,
  14. absl::optional<char16_t>* shifted_char);
  15. } // namespace electron
  16. #endif // ELECTRON_SHELL_COMMON_KEYBOARD_UTIL_H_