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

Unified Diff: ui/events/ozone/evdev/event_device_info.cc

Issue 797483002: ozone: evdev: Populate keyboard list on DeviceDataManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/ozone/evdev/event_device_info.h ('k') | ui/events/ozone/evdev/event_factory_evdev.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/ozone/evdev/event_device_info.cc
diff --git a/ui/events/ozone/evdev/event_device_info.cc b/ui/events/ozone/evdev/event_device_info.cc
index 75688ac2da19e95ee7725b0b33e62d361eaa7e5d..25105ef4ee521c4ffd859bcbbbbef89f6441bd38 100644
--- a/ui/events/ozone/evdev/event_device_info.cc
+++ b/ui/events/ozone/evdev/event_device_info.cc
@@ -233,6 +233,19 @@ bool EventDeviceInfo::IsMappedToScreen() const {
return true;
}
+bool EventDeviceInfo::HasKeyboard() const {
+ if (!HasEventType(EV_KEY))
+ return false;
+
+ // Check first 31 keys: If we have all of them, consider it a full
+ // keyboard. This is exactly what udev does for ID_INPUT_KEYBOARD.
+ for (int key = KEY_ESC; key <= KEY_D; ++key)
sadrul 2014/12/11 15:41:37 {}?
+ if (!HasKeyEvent(key))
+ return false;
+
+ return true;
+}
+
const std::vector<int32_t>& EventDeviceInfo::GetMtSlotsForCode(int code) const {
int index = code - ABS_MT_SLOT - 1;
DCHECK_LE(0, index) << code << " is not a valid multi-touch code";
« no previous file with comments | « ui/events/ozone/evdev/event_device_info.h ('k') | ui/events/ozone/evdev/event_factory_evdev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698