forked from adamlaska/electron
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkeyboard_util.h
More file actions
27 lines (19 loc) · 890 Bytes
/
keyboard_util.h
File metadata and controls
27 lines (19 loc) · 890 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// 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 <string>
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "ui/events/keycodes/keyboard_codes.h"
namespace electron {
// Return key code of the char, and also determine whether the SHIFT key is
// pressed.
ui::KeyboardCode KeyboardCodeFromCharCode(char16_t c, bool* shifted);
// 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(const std::string& str,
absl::optional<char16_t>* shifted_char);
} // namespace electron
#endif // ELECTRON_SHELL_COMMON_KEYBOARD_UTIL_H_