keyboard_util.h 697 B

1234567891011121314151617181920212223
  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 <optional>
  7. #include <string_view>
  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(std::string_view str,
  14. std::optional<char16_t>* shifted_char);
  15. } // namespace electron
  16. #endif // ELECTRON_SHELL_COMMON_KEYBOARD_UTIL_H_