2015-09-18 05:33:06 +00:00
|
|
|
// Copyright (c) 2015 GitHub, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#ifndef ELECTRON_SHELL_COMMON_KEYBOARD_UTIL_H_
|
|
|
|
#define ELECTRON_SHELL_COMMON_KEYBOARD_UTIL_H_
|
2015-09-18 05:33:06 +00:00
|
|
|
|
2023-06-22 12:33:44 +00:00
|
|
|
#include "base/strings/string_piece.h"
|
2021-06-03 08:05:04 +00:00
|
|
|
#include "third_party/abseil-cpp/absl/types/optional.h"
|
2015-09-18 05:33:06 +00:00
|
|
|
#include "ui/events/keycodes/keyboard_codes.h"
|
|
|
|
|
2019-06-19 21:23:04 +00:00
|
|
|
namespace electron {
|
2015-09-18 05:33:06 +00:00
|
|
|
|
2021-06-02 07:32:48 +00:00
|
|
|
// Return key code of the |str|, if the original key is a shifted character,
|
|
|
|
// for example + and /, set it in |shifted_char|.
|
2015-09-18 05:33:06 +00:00
|
|
|
// pressed.
|
2023-06-22 12:33:44 +00:00
|
|
|
ui::KeyboardCode KeyboardCodeFromStr(base::StringPiece str,
|
2021-06-03 08:05:04 +00:00
|
|
|
absl::optional<char16_t>* shifted_char);
|
2015-09-18 05:33:06 +00:00
|
|
|
|
2019-06-19 21:23:04 +00:00
|
|
|
} // namespace electron
|
2015-09-18 05:33:06 +00:00
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#endif // ELECTRON_SHELL_COMMON_KEYBOARD_UTIL_H_
|