OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef DEVICE_HID_HID_USAGE_AND_PAGE_H_ |
| 6 #define DEVICE_HID_HID_USAGE_AND_PAGE_H_ |
| 7 |
| 8 #include <stdint.h> |
| 9 |
| 10 #include <ostream> |
| 11 |
| 12 namespace device { |
| 13 |
| 14 struct HidUsageAndPage { |
| 15 enum Page { |
| 16 kPageUndefined = 0x00, |
| 17 kPageGenericDesktop = 0x01, |
| 18 kPageSimulation = 0x02, |
| 19 kPageVirtualReality = 0x03, |
| 20 kPageSport = 0x04, |
| 21 kPageGame = 0x05, |
| 22 kPageKeyboard = 0x07, |
| 23 kPageLed = 0x08, |
| 24 kPageButton = 0x09, |
| 25 kPageOrdinal = 0x0A, |
| 26 kPageTelephony = 0x0B, |
| 27 kPageConsumer = 0x0C, |
| 28 kPageDigitizer = 0x0D, |
| 29 kPagePidPage = 0x0F, |
| 30 kPageUnicode = 0x10, |
| 31 kPageAlphanumericDisplay = 0x14, |
| 32 kPageMedicalInstruments = 0x40, |
| 33 kPageMonitor0 = 0x80, |
| 34 kPageMonitor1 = 0x81, |
| 35 kPageMonitor2 = 0x82, |
| 36 kPageMonitor3 = 0x83, |
| 37 kPagePower0 = 0x84, |
| 38 kPagePower1 = 0x85, |
| 39 kPagePower2 = 0x86, |
| 40 kPagePower3 = 0x87, |
| 41 kPageBarCodeScanner = 0x8C, |
| 42 kPageScale = 0x8D, |
| 43 kPageMagneticStripeReader = 0x8E, |
| 44 kPageReservedPointOfSale = 0x8F, |
| 45 kPageCameraControl = 0x90, |
| 46 kPageArcade = 0x91, |
| 47 kPageVendor = 0xFF00, |
| 48 kPageMediaCenter = 0xFFBC |
| 49 }; |
| 50 |
| 51 HidUsageAndPage(uint16_t usage, Page usage_page) |
| 52 : usage(usage), usage_page(usage_page) {} |
| 53 ~HidUsageAndPage() {} |
| 54 |
| 55 uint16_t usage; |
| 56 Page usage_page; |
| 57 |
| 58 bool operator==(const HidUsageAndPage& other) const; |
| 59 }; |
| 60 |
| 61 std::ostream& operator<<(std::ostream& os, |
| 62 const HidUsageAndPage::Page& usage_page); |
| 63 |
| 64 std::ostream& operator<<(std::ostream& os, |
| 65 const HidUsageAndPage& usage_and_page); |
| 66 |
| 67 } // namespace device |
| 68 |
| 69 #endif // DEVICE_HID_HID_USAGE_AND_PAGE_H_ |
OLD | NEW |