electron/shell/common/keyboard_util.h
Milan Burda 892c9d78a3
chore: replace absl::optional<T> with std::optional<T> (#40928)
* chore: replace absl::optional<T> with std::optional<T>

* IWYU
2024-01-10 16:23:35 -06:00

23 lines
714 B
C++

// Copyright (c) 2015 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ELECTRON_SHELL_COMMON_KEYBOARD_UTIL_H_
#define ELECTRON_SHELL_COMMON_KEYBOARD_UTIL_H_
#include <optional>
#include "base/strings/string_piece.h"
#include "ui/events/keycodes/keyboard_codes.h"
namespace electron {
// Return key code of the |str|, if the original key is a shifted character,
// for example + and /, set it in |shifted_char|.
// pressed.
ui::KeyboardCode KeyboardCodeFromStr(base::StringPiece str,
std::optional<char16_t>* shifted_char);
} // namespace electron
#endif // ELECTRON_SHELL_COMMON_KEYBOARD_UTIL_H_