Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: ui/events/keycodes/dom4/keycode_converter.cc

Issue 756643006: Remote assistance on Chrome OS Part IX - Input injection on Ozone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Ozone_input_injection
Patch Set: Add UsbCode to DomCode API Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/events/keycodes/dom4/keycode_converter.cc
diff --git a/ui/events/keycodes/dom4/keycode_converter.cc b/ui/events/keycodes/dom4/keycode_converter.cc
index 8a19dcb6233ce77722a234ebf197b1b13937cca6..558b99a6fe838e1573ae71e108a3dec6b975ea8c 100644
--- a/ui/events/keycodes/dom4/keycode_converter.cc
+++ b/ui/events/keycodes/dom4/keycode_converter.cc
@@ -210,6 +210,15 @@ const char* KeycodeConverter::UsbKeycodeToCode(uint32_t usb_keycode) {
}
// static
+DomCode KeycodeConverter::UsbKeycodeToDomCode(uint32_t usb_keycode) {
+ for (size_t i = 0; i < kKeycodeMapEntries; ++i) {
+ if (usb_keycode_map[i].usb_keycode == usb_keycode)
+ return static_cast<DomCode>(usb_keycode);
+ }
+ return DomCode::NONE;
+}
+
+// static
uint32_t KeycodeConverter::CodeToUsbKeycode(const char* code) {
if (!code ||
strcmp(code, InvalidKeyboardEventCode()) == 0) {
« remoting/host/input_injector_chromeos.cc ('K') | « ui/events/keycodes/dom4/keycode_converter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698