When joystick support is not present, `event_joystick_get_button` is not
declared in joy.h.
Fixes: c24864b180 ("make menus controllable with joystick")
If axes!=0 and buttons==0 and hats==0, then the build fails because some
button-related functionality is missing. Move the joystick axis->button
bridge into a conditional to exclude it in this case.
Fixes: 74ef8b02e6 ("Added axis buttons")
Instead of parsing the button name string,
an explicit button-to-key mapping table
is now built and used.
Also fixes a few minor inconsistencies
that were introduced in c24864b1.
In most menus, keyboard commands are synthesized
from controller buttons, leveraging the existing
axis-to-button translation.
Menu controls are currently fixed:
- button 0 (A) is confirm (Enter)
- button 1 (B) is cancel (Esc)
- button 2 (X) is switch (Space)
- button 3 (Y) is delete (Delete)
- axes 0 and 1 (main analog pad) maps to cursor keys
- all hats (D-pads) map to cursor keys
Title screens and credits can be confirmed
with any joystick button or axis motion too.
Each axis can act as two buttons in both ways.
For example, a player might map slide left and slide right to J1 -A1 and J1 +A1 as button presses instead of the slide L/R axis.
This is mostly to fix XBox 360 Controller Left and Right triggers. But it can work on every axis if the player wishes to bind them.
For each link given as http://, verify that the site is accessible over
https:// and, if so, switch to it. These domains were converted:
* llvm.org
* clang.llvm.org
* en.cppreference.com
* www.dxx-rebirth.com
* www.libsdl.org
* www.scons.org
This will allow checking for window_event_result::deleted, instead of relying on window_exists, which could return a false positive if a new window was allocated with the same pointer value as the deleted one.
Rename symbol MAX_HATS_PER_JOYSTICK to DXX_MAX_HATS_PER_JOYSTICK
to show that it is a DXX symbol, not one inherited from a library.
git grep -lzw MAX_HATS_PER_JOYSTICK -- SConstruct '*.h' '*.cpp' | xargs -0 sed -i -e 's/\<MAX_HATS_PER_JOYSTICK\>/DXX_&/g'
Rename symbol MAX_BUTTONS_PER_JOYSTICK to DXX_MAX_BUTTONS_PER_JOYSTICK
to show that it is a DXX symbol, not one inherited from a library.
git grep -lzw MAX_BUTTONS_PER_JOYSTICK -- SConstruct '*.h' '*.cpp' | xargs -0 sed -i -e 's/\<MAX_BUTTONS_PER_JOYSTICK\>/DXX_&/g'
Rename symbol MAX_AXES_PER_JOYSTICK to DXX_MAX_AXES_PER_JOYSTICK to show
that it is a DXX symbol, not one inherited from a library.
git grep -lzw MAX_AXES_PER_JOYSTICK -- SConstruct '*.h' '*.cpp' | xargs -0 sed -i -e 's/\<MAX_AXES_PER_JOYSTICK\>/DXX_&/g'
Rename symbol MAX_JOYSTICKS to DXX_MAX_JOYSTICKS to show that it is a DXX
symbol, not one inherited from a library.
git grep -lzw MAX_JOYSTICKS -- SConstruct '*.h' '*.cpp' | xargs -0 sed -i -e 's/\<MAX_JOYSTICKS\>/DXX_&/g'