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

Side by Side Diff: ui/events/ozone/evdev/event_device_info.h

Issue 2805793002: ozone: evdev: Add gamepad support (Closed)
Patch Set: Support Gamepad in Ozone. Created 3 years, 7 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_INFO_H_ 5 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_INFO_H_
6 #define UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_INFO_H_ 6 #define UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_INFO_H_
7 7
8 #include <limits.h> 8 #include <limits.h>
9 #include <linux/input.h> 9 #include <linux/input.h>
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 void SetRelEvents(const unsigned long* rel_bits, size_t len); 62 void SetRelEvents(const unsigned long* rel_bits, size_t len);
63 void SetAbsEvents(const unsigned long* abs_bits, size_t len); 63 void SetAbsEvents(const unsigned long* abs_bits, size_t len);
64 void SetMscEvents(const unsigned long* msc_bits, size_t len); 64 void SetMscEvents(const unsigned long* msc_bits, size_t len);
65 void SetSwEvents(const unsigned long* sw_bits, size_t len); 65 void SetSwEvents(const unsigned long* sw_bits, size_t len);
66 void SetLedEvents(const unsigned long* led_bits, size_t len); 66 void SetLedEvents(const unsigned long* led_bits, size_t len);
67 void SetProps(const unsigned long* prop_bits, size_t len); 67 void SetProps(const unsigned long* prop_bits, size_t len);
68 void SetAbsInfo(unsigned int code, const input_absinfo& absinfo); 68 void SetAbsInfo(unsigned int code, const input_absinfo& absinfo);
69 void SetAbsMtSlots(unsigned int code, const std::vector<int32_t>& values); 69 void SetAbsMtSlots(unsigned int code, const std::vector<int32_t>& values);
70 void SetAbsMtSlot(unsigned int code, unsigned int slot, uint32_t value); 70 void SetAbsMtSlot(unsigned int code, unsigned int slot, uint32_t value);
71 void SetDeviceType(InputDeviceType type); 71 void SetDeviceType(InputDeviceType type);
72 void SetId(uint16_t vendor_id, uint16_t product_id);
72 73
73 // Check events this device can generate. 74 // Check events this device can generate.
74 bool HasEventType(unsigned int type) const; 75 bool HasEventType(unsigned int type) const;
75 bool HasKeyEvent(unsigned int code) const; 76 bool HasKeyEvent(unsigned int code) const;
76 bool HasRelEvent(unsigned int code) const; 77 bool HasRelEvent(unsigned int code) const;
77 bool HasAbsEvent(unsigned int code) const; 78 bool HasAbsEvent(unsigned int code) const;
78 bool HasMscEvent(unsigned int code) const; 79 bool HasMscEvent(unsigned int code) const;
79 bool HasSwEvent(unsigned int code) const; 80 bool HasSwEvent(unsigned int code) const;
80 bool HasLedEvent(unsigned int code) const; 81 bool HasLedEvent(unsigned int code) const;
81 82
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 133
133 // Determine whether there's a touchpad on this device. 134 // Determine whether there's a touchpad on this device.
134 bool HasTouchpad() const; 135 bool HasTouchpad() const;
135 136
136 // Determine whether there's a tablet on this device. 137 // Determine whether there's a tablet on this device.
137 bool HasTablet() const; 138 bool HasTablet() const;
138 139
139 // Determine whether there's a touchscreen on this device. 140 // Determine whether there's a touchscreen on this device.
140 bool HasTouchscreen() const; 141 bool HasTouchscreen() const;
141 142
143 // Determine whether there's a gamepad on this device.
144 bool HasGamepad() const;
145
142 // The device type (internal or external.) 146 // The device type (internal or external.)
143 InputDeviceType device_type() const { return device_type_; } 147 InputDeviceType device_type() const { return device_type_; }
144 148
145 private: 149 private:
146 enum class LegacyAbsoluteDeviceType { 150 enum class LegacyAbsoluteDeviceType {
147 LADT_TOUCHPAD, 151 LADT_TOUCHPAD,
148 LADT_TOUCHSCREEN, 152 LADT_TOUCHSCREEN,
149 LADT_TABLET, 153 LADT_TABLET,
150 LADT_NONE, 154 LADT_NONE,
151 }; 155 };
(...skipping 23 matching lines...) Expand all
175 179
176 // Whether this is an internal or external device. 180 // Whether this is an internal or external device.
177 InputDeviceType device_type_ = InputDeviceType::INPUT_DEVICE_UNKNOWN; 181 InputDeviceType device_type_ = InputDeviceType::INPUT_DEVICE_UNKNOWN;
178 182
179 DISALLOW_COPY_AND_ASSIGN(EventDeviceInfo); 183 DISALLOW_COPY_AND_ASSIGN(EventDeviceInfo);
180 }; 184 };
181 185
182 } // namspace ui 186 } // namspace ui
183 187
184 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_INFO_H_ 188 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_INFO_H_
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/event_converter_test_util.cc ('k') | ui/events/ozone/evdev/event_device_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698