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

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: Address feedback (wez) Created 6 years 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
« no previous file with comments | « ui/events/keycodes/dom4/keycode_converter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 798191c4d22eaa259ee2380cb63b9ef837a82da7..7c81862278f1bf1f126f33f20fc32cc01af4d4a6 100644
--- a/ui/events/keycodes/dom4/keycode_converter.cc
+++ b/ui/events/keycodes/dom4/keycode_converter.cc
@@ -204,6 +204,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 || !*code)
return InvalidUsbKeycode();
« no previous file with comments | « 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