| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "ui/events/ozone/evdev/event_device_test_util.h" | 5 #include "ui/events/ozone/evdev/event_device_test_util.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 // Require canonically formatted input. | 73 // Require canonically formatted input. |
| 74 if (bitfield != SerializeBitfield(out->data(), max_bits)) | 74 if (bitfield != SerializeBitfield(out->data(), max_bits)) |
| 75 return false; | 75 return false; |
| 76 | 76 |
| 77 return true; | 77 return true; |
| 78 } | 78 } |
| 79 | 79 |
| 80 } // namespace | 80 } // namespace |
| 81 | 81 |
| 82 // Caputered from xbox 360 gamepad. |
| 83 const DeviceAbsoluteAxis kXboxGamepadAbsAxes[] = { |
| 84 {ABS_X, {0, -32768, 32767, 16, 128}}, |
| 85 {ABS_Y, {0, -32768, 32767, 16, 128}}, |
| 86 {ABS_Z, {0, 0, 255, 0, 0}}, |
| 87 {ABS_RX, {0, -32768, 32767, 16, 128}}, |
| 88 {ABS_RY, {0, -32768, 32767, 16, 128}}, |
| 89 {ABS_RZ, {0, 0, 255, 0, 0}}, |
| 90 {ABS_HAT0X, {0, -1, 1, 0, 0}}, |
| 91 {ABS_HAT0Y, {0, -1, 1, 0, 0}}}; |
| 92 |
| 93 const DeviceCapabilities kXboxGamepad = { |
| 94 /* path */ |
| 95 "/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.2/1-2.2:1.0/" |
| 96 "input/input38/event11", |
| 97 /* name */ "Microsoft X-Box 360 pad", |
| 98 /* phys */ "usb-0000:00:14.0-2.2/input0", |
| 99 /* uniq */ "", |
| 100 /* bustype */ "0011", |
| 101 /* vendor */ "045e", |
| 102 /* product */ "028e", |
| 103 /* version */ "0114", |
| 104 /* prop */ "0", |
| 105 /* ev */ "20000b", |
| 106 /* key */ "7cdb000000000000 0 0 0 0", |
| 107 /* rel */ "0", |
| 108 /* abs */ "3003f", |
| 109 /* msc */ "0", |
| 110 /* sw */ "0", |
| 111 /* led */ "0", |
| 112 /* ff */ "0", |
| 113 kXboxGamepadAbsAxes, |
| 114 arraysize(kXboxGamepadAbsAxes), |
| 115 }; |
| 116 |
| 82 // Captured from Chromebook Pixel. | 117 // Captured from Chromebook Pixel. |
| 83 const DeviceCapabilities kLinkKeyboard = { | 118 const DeviceCapabilities kLinkKeyboard = { |
| 84 /* path */ "/sys/devices/platform/i8042/serio0/input/input6/event6", | 119 /* path */ "/sys/devices/platform/i8042/serio0/input/input6/event6", |
| 85 /* name */ "AT Translated Set 2 keyboard", | 120 /* name */ "AT Translated Set 2 keyboard", |
| 86 /* phys */ "isa0060/serio0/input0", | 121 /* phys */ "isa0060/serio0/input0", |
| 87 /* uniq */ "", | 122 /* uniq */ "", |
| 88 /* bustype */ "0011", | 123 /* bustype */ "0011", |
| 89 /* vendor */ "0001", | 124 /* vendor */ "0001", |
| 90 /* product */ "0001", | 125 /* product */ "0001", |
| 91 /* version */ "ab83", | 126 /* version */ "ab83", |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 } | 530 } |
| 496 | 531 |
| 497 int bustype = 0; | 532 int bustype = 0; |
| 498 sscanf(capabilities.bustype, "%x", &bustype); | 533 sscanf(capabilities.bustype, "%x", &bustype); |
| 499 devinfo->SetDeviceType(InputDeviceTypeFromBusType(bustype)); | 534 devinfo->SetDeviceType(InputDeviceTypeFromBusType(bustype)); |
| 500 | 535 |
| 501 return true; | 536 return true; |
| 502 } | 537 } |
| 503 | 538 |
| 504 } // namespace ui | 539 } // namespace ui |
| OLD | NEW |