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

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
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);
Wez 2014/12/09 01:36:44 Return usb_keycode_map[i].id rather than the stati
kelvinp 2014/12/09 20:24:18 Unfortunately, the id field does not exist on Linu
+ }
+ return DomCode::NONE;
+}
+
+// static
uint32_t KeycodeConverter::CodeToUsbKeycode(const char* code) {
if (!code || !*code)
return InvalidUsbKeycode();
« remoting/host/chromeos/point_transformer.h ('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