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"; |