#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <algorithm>
#include "base/strings/utf_string_conversions.h"
#include "chrome/test/chromedriver/chrome/ui_events.h"
#include "chrome/test/chromedriver/keycode_text_conversion.h"
#include "ui/base/x/x11_util.h"
#include "ui/events/keycodes/keyboard_code_conversion_x.h"
#include "ui/gfx/x/connection.h"
#include "ui/gfx/x/keysyms/keysyms.h"
namespace {
struct KeyCodeAndXKeyCode { … };
KeyCodeAndXKeyCode kKeyCodeToXKeyCode[] = …;
bool operator<(const KeyCodeAndXKeyCode& a, const KeyCodeAndXKeyCode& b) { … }
int KeyboardCodeToXKeyCode(ui::KeyboardCode key_code) { … }
bool GetXModifierMask(x11::Connection* connection,
int modifier,
x11::KeyButMask* x_modifier) { … }
}
bool ConvertKeyCodeToText(ui::KeyboardCode key_code,
int modifiers,
std::string* text,
std::string* error_msg) { … }
bool ConvertCharToKeyCode(char16_t key,
ui::KeyboardCode* key_code,
int* necessary_modifiers,
std::string* error_msg) { … }