Non-abbreviated JoystickHat constants

Issue #1299 open
hahawoo
created an issue

The JoystickHat constants ('c', 'd', 'l', 'ld', 'lu', 'r', 'rd', 'ru' and 'u') seem inconsistent with other constants in that that they shorten words to single letters.

GamepadButton for example has 'leftstick', GamepadAxis has 'triggerright', AlignMode has 'center' etc.

So I think JoystickHat should be 'center', 'leftdown', etc.

Comments (5)

  1. Pablo Mayobre

    How about separating them?

    So you get x, y where x is the position in the x axis so left, center or right and y is the position in the y axis so top, center or down

    Just a different opinion

  2. Gabe Stilez

    I guess that would work, though i think everything else treats d-pads as just one input, instead of axis-separated like that; mostly because the diagonals are also "first-class" as it were.

    Still, it could work that way.

    As for the cardinal directions, that solution sounds nice too, but i don't know if center would be the word i use in that case... not that i can think up a better term for it sadly.

  3. hahawoo reporter

    I'm really not sure about the names. Up/down/left/right are kind of more obvious because they're more commonly used words (i.e. I never think that I pressed the "east" button, I think that I pressed the "right" button, and when hearing "east" it can take me a second to think "is east left or right?"), and they are consistent with GamepadButton's dpup/dpdown/dpleft/dpright, but it's a good point that north/south/east/west combine in a standard manner. So, I'm unsure.

    Has anyone considered what it would be like if hat directions were turned into buttons like it seems d-pads are with virtual gamepads? My first thoughts were that it would be consistent with virtual gamepads and the API would be simpler via not having the concept of a hat anymore, but I have no idea what the consequences would be for API-using code.

  4. Log in to comment