1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-07-03 06:24:32 +00:00

Fix some regressions + improvements:

- ACTION_MENU* not sent
- allow using the game UI with keyboard only
- allow mapping ACTION_MENU to controller inputs
- fix joystick axis (-) not working due to typo
This commit is contained in:
fgenesis 2016-07-17 02:34:34 +02:00
parent bf94d541cd
commit 671d0ace1b
8 changed files with 71 additions and 40 deletions

View file

@ -156,6 +156,9 @@ bool ActionMapper::_pollActionData(const ActionData& ad)
bool ActionMapper::getKeyState(int k)
{
if(!k)
return false;
bool keyState = false;
if (k >= 0 && k < KEY_MAXARRAY)
{
@ -203,7 +206,7 @@ bool ActionMapper::getKeyState(int k)
}
else if (k >= JOY_AXIS_0_NEG && k < JOY_AXIS_END_NEG)
{
int v = k - JOY_AXIS_END_NEG;
int v = k - JOY_AXIS_0_NEG;
for(size_t i = 0; i < core->getNumJoysticks(); ++i)
if(Joystick *j = core->getJoystick(i))
@ -254,7 +257,7 @@ void ActionMapper::onUpdate (float dt)
}
else
{
action(ad->id, keyState, -1); // FG: FIXME
action(ad->id, keyState, ad->source);
}
if (core->loopDone) goto out;
}