Added the option to KeyboardEvent to specify the sent character by it's name (if it can't be sent via the keyCode parameter)

This commit is contained in:
Heilig Benedek 2015-11-16 04:15:13 +01:00
parent 9987082de5
commit bb6d7d1498
3 changed files with 42 additions and 5 deletions

View file

@ -5,13 +5,18 @@
#ifndef ATOM_COMMON_KEYBOAD_UTIL_H_
#define ATOM_COMMON_KEYBOAD_UTIL_H_
#include <string>
#include "ui/events/keycodes/keyboard_codes.h"
#include "base/strings/string_util.h"
namespace atom {
// Return key code of the char, and also determine whether the SHIFT key is
// pressed.
ui::KeyboardCode KeyboardCodeFromCharCode(char c, bool* shifted);
ui::KeyboardCode KeyboardCodeFromCharCode(base::char16 c, bool* shifted);
// Return key code of the char from a string representation of the char
ui::KeyboardCode KeyboardCodeFromKeyIdentifier(std::string chr);
} // namespace atom