The function ‘getButton’ returns true or false based on whether a given button is pressed or not. So which numerical value corresponds to each button on the joystick?

We are planning to document that. The version of DriverStation that was uploaded last week maps the buttons according to the following diagram: https://w3c.github.io/gamepad/standard_gamepad.svg.

The analog values are mapped a little differently than the diagram. We decided that it makes more sense to have the “forward” direction be positive and “backwards” to be negative (which is opposite the default).

Note: the new version works for Linux & Windows.  Mapping for Chromebook will be added soon.