MHeironimus / ArduinoJoystickLibrary

An Arduino library that adds one or more joysticks to the list of HID devices an Arduino Leonardo or Arduino Micro can support.
GNU Lesser General Public License v3.0
2.06k stars 403 forks source link

Added support for slider, dial and 4 hat switches #206

Open gavazquez opened 3 years ago

gavazquez commented 3 years ago

I implemented the changes of this PR: https://github.com/MHeironimus/ArduinoJoystickLibrary/pull/129 But I also added support for 4 hat switches (they are very useful for hotas controllers)

I also added a limit of 128 buttons as that's the maximum that HID supports

MHeironimus commented 3 years ago

Just curious if you have a reference for your statement "a limit of 128 buttons as that's the maximum that HID supports". My understanding was the limit was 0xFFFF (65535) based on what I have read in section 12 Button Page of the https://usb.org/sites/default/files/documents/hut1_12v2.pdf, but I don't think many applications/operating systems can actually see that many. The library supports up to 255, but most applications cannot see that many. There is a section about this in the FAQ (https://github.com/MHeironimus/ArduinoJoystickLibrary/wiki/FAQ).

gavazquez commented 3 years ago

You're right. The app I was using couldn't see past 128 buttons and I saw that some other people took that limit aswell so I assumed that it was the standard.

The 4 hat switches are useful tough since many high end joysticks have them: https://virpil.com/images/2019/02/16/MT-50CM2_02.png