Linux Fix for Gamepad + Media Keys
This commit is contained in:
parent
2659e91e6a
commit
ea39ad5ca6
4 changed files with 12 additions and 7 deletions
|
|
@ -164,13 +164,16 @@ const u8 _hidReportDescriptor[] = {
|
|||
0x09, 0x01, // usage -- consumer control
|
||||
0xA1, 0x01, // collection (application)
|
||||
0x85, HID_REPORTID_MediaReport, // report id
|
||||
//0x05, 0x0C, // usage page (consumer)
|
||||
|
||||
// 4 media Keys
|
||||
0x15, 0x00, //logical minimum
|
||||
0x26, 0xFF, 0xFF, //logical maximum (3ff)
|
||||
0x26, 0xFF, 0x03, //logical maximum (3ff)
|
||||
0x19, 0x00, // usage minimum (0)
|
||||
0x2A, 0xFF, 0xFF, //usage maximum (3ff)
|
||||
0x2A, 0xFF, 0x03, //usage maximum (3ff)
|
||||
0x95, 0x04, //report count (4)
|
||||
0x75, 0x10, //report size (16)
|
||||
|
||||
0x81, 0x00, //input
|
||||
0xC0, //end collection
|
||||
#endif
|
||||
|
|
@ -195,7 +198,7 @@ const u8 _hidReportDescriptor[] = {
|
|||
#ifdef HID_GAMEPAD1_ENABLE
|
||||
// Gamepad1
|
||||
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
|
||||
0x09, 0x05, // USAGE (Game Pad)
|
||||
0x09, 0x04, // USAGE (Joystick)
|
||||
0xa1, 0x01, // COLLECTION (Application)
|
||||
0x85, HID_REPORTID_Gamepad1Report, // REPORT_ID
|
||||
// 32 Buttons
|
||||
|
|
@ -248,7 +251,7 @@ const u8 _hidReportDescriptor[] = {
|
|||
#ifdef HID_GAMEPAD2_ENABLE
|
||||
// Gamepad2
|
||||
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
|
||||
0x09, 0x05, // USAGE (Game Pad)
|
||||
0x09, 0x04, // USAGE (Joystick)
|
||||
0xa1, 0x01, // COLLECTION (Application)
|
||||
0x85, HID_REPORTID_Gamepad2Report, // REPORT_ID
|
||||
// 32 Buttons
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ THE SOFTWARE.
|
|||
//#define HID_GAMEPAD2_ENABLE 71
|
||||
//#define HID_JOYSTICK1_ENABLE 51
|
||||
//#define HID_JOYSTICK2_ENABLE 51
|
||||
//#define HID_MIDI_ENABLE
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -6,4 +6,6 @@ HID Source
|
|||
C:\Arduino\arduino-1.0.5\hardware\arduino\cores\arduino
|
||||
C:\Arduino\arduino-1.5.6-r2\hardware\arduino\avr\cores\arduino
|
||||
C:\Arduino\arduino-1.5.7\hardware\arduino\avr\cores\arduino
|
||||
```
|
||||
```
|
||||
|
||||
Restart the IDE!
|
||||
|
|
@ -32,7 +32,7 @@ I also corrected some bugs in the original sources.
|
|||
|
||||
* Keyboard (modifiers + 6 keys pressed at the same time)
|
||||
* Mouse (5 buttons, move, wheel)
|
||||
* Media Keys (4 keys for music player and more)
|
||||
* Media Keys (4 keys for music player, webbrowser and more)
|
||||
* System Key (for PC standby/shutdown)
|
||||
* 2 Gamepads (32 buttons, 6 16bit axis, 2 D-Pads)
|
||||
* 2 Joysticks (2 buttons, 2 10bit axis)
|
||||
|
|
@ -52,6 +52,7 @@ C:\Arduino\arduino-1.5.6-r2\hardware\arduino\avr\cores\arduino
|
|||
C:\Arduino\arduino-1.5.7\hardware\arduino\avr\cores\arduino
|
||||
```
|
||||
The installation path may differ to yours. Newer Versions than 1.5.7 may not work.
|
||||
Restart the IDE!
|
||||
|
||||
**I strongly recommend to install the library like this. Otherwise it wont work.**
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue