<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 20 Nov 2020 at 15:48, Ralph Versteegen <<a href="mailto:teeemcee@gmail.com">teeemcee@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>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.</div><div><div><br></div><div>(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.)</div></div><br><div>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 <code>joy:up/down/left/right</code> 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.<br></div></div></blockquote><div><br></div><div>Also, I think we should also add four more up/down/left/right virtual buttons for the right thumbstick. That way, if you want to use it for 8-directional input you don't need to write a complicated script to convert x and y into angle then into directions, while compensating for the dead zone. I've been asked to add commands to get the angle and magnitude/displacement of a stick too, but it's still nontrivial to go from angle to 8 directions.</div><div>Note this would imply that if you want the dpad and left stick to be separate you still need to figure out what to do with the angle of the left stick yourself, since there wouldn't be up/down/left/right virtual buttons for it. I don't see that as a concern.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div><br></div><div><div><div>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?</div></div></div><br><div>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.<br></div></div>
</blockquote></div></div>