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.
|
|
|
|
|
2016-01-31 01:27:14 +00:00
|
|
|
#ifndef ATOM_COMMON_KEYBOARD_UTIL_H_
|
|
|
|
#define ATOM_COMMON_KEYBOARD_UTIL_H_
|
2015-09-18 05:33:06 +00:00
|
|
|
|
2015-11-16 03:15:13 +00:00
|
|
|
#include <string>
|
2015-09-18 05:33:06 +00:00
|
|
|
#include "ui/events/keycodes/keyboard_codes.h"
|
2015-11-16 03:15:13 +00:00
|
|
|
#include "base/strings/string_util.h"
|
2015-09-18 05:33:06 +00:00
|
|
|
|
|
|
|
namespace atom {
|
|
|
|
|
|
|
|
// Return key code of the char, and also determine whether the SHIFT key is
|
|
|
|
// pressed.
|
2015-11-16 03:15:13 +00:00
|
|
|
ui::KeyboardCode KeyboardCodeFromCharCode(base::char16 c, bool* shifted);
|
|
|
|
|
|
|
|
// Return key code of the char from a string representation of the char
|
2015-11-16 13:51:26 +00:00
|
|
|
ui::KeyboardCode KeyboardCodeFromKeyIdentifier(const std::string& chr);
|
2015-09-18 05:33:06 +00:00
|
|
|
|
|
|
|
} // namespace atom
|
|
|
|
|
2016-01-31 01:27:14 +00:00
|
|
|
#endif // ATOM_COMMON_KEYBOARD_UTIL_H_
|