[Ohrrpgce] Gamepad buttons/axes

Ralph Versteegen teeemcee at gmail.com
Thu Nov 19 18:48:53 PST 2020


Using SDL2's gamecontroller API will allow a consistent numbering of
buttons and axes, so we'll add new constants for them. E.g. A, B, X, Y
buttons will be 0-3.

(Also, DirectInput and SDL's joystick API report hats in addition to
buttons and axes, but we currently ignore those and apparently can continue
to.)

I'm not a gamepad user so I'm a bit confused about how to handle the
dpad... should both the (left) dpad and the left thumbstick, if they exist,
be mapped to the same thing, and appear both as joy:up/down/left/right
buttons and also as x/y axes? I'm told some games treat them separately, so
we can provide an option to separate them; though it seems to me combining
them should be the default. I guess that should be game setting rather than
a player-controlled setting, because either the game is scripted to expect
them to be separate (in which case it's unplayable with a gamepad that
doesn't have/report both), or it doesn't in which case there's no reason
for a player to separate them.

Also, I see that SDL2 and Android at least both report L1, R1 shoulder
triggers/buttons as buttons, but L2, R2 triggers as axes, not buttons. I
guess we should report L1/L2/R1/R2 as four buttons, and also L2/R2 as axes?

I'm going to punt the question of how to handle mapping of joysticks to
player numbers (which SDL2 also has functions for) to a future version.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20201120/95467eef/attachment.html>


More information about the Ohrrpgce mailing list