(Apple) Fix mapping of gamepad negative axis; the input binding menu now polls the proper gamepad rather than always polling player 1’s.

This commit is contained in:
meancoot 2013-12-10 16:53:01 -05:00
parent 693a826f2f
commit 4c493ae9b4
2 changed files with 8 additions and 6 deletions

View File

@ -137,13 +137,14 @@ static const void* associated_name_tag = (void*)&associated_name_tag;
- (void)checkBind:(NSTimer*)send
{
int32_t value = 0;
int32_t index = _setting->index ? _setting->index - 1 : 0;
if ((value = apple_input_find_any_key()))
BINDFOR(*_setting).key = input_translate_keysym_to_rk(value);
else if ((value = apple_input_find_any_button(0)) >= 0)
else if ((value = apple_input_find_any_button(index)) >= 0)
BINDFOR(*_setting).joykey = value;
else if ((value = apple_input_find_any_axis(0)))
BINDFOR(*_setting).joyaxis = (value > 0) ? AXIS_POS(value - 1) : AXIS_NEG(value - 1);
else if ((value = apple_input_find_any_axis(index)))
BINDFOR(*_setting).joyaxis = (value > 0) ? AXIS_POS(value - 1) : AXIS_NEG(abs(value) - 1);
else
return;

View File

@ -400,13 +400,14 @@ static void RunActionSheet(const char* title, const struct string_list* items, U
- (void)checkBind:(NSTimer*)send
{
int32_t value = 0;
int32_t index = self.setting->index ? self.setting->index - 1 : 0;
if ((value = apple_input_find_any_key()))
BINDFOR(*self.setting).key = input_translate_keysym_to_rk(value);
else if ((value = apple_input_find_any_button(0)) >= 0)
else if ((value = apple_input_find_any_button(index)) >= 0)
BINDFOR(*self.setting).joykey = value;
else if ((value = apple_input_find_any_axis(0)))
BINDFOR(*self.setting).joyaxis = (value > 0) ? AXIS_POS(value - 1) : AXIS_NEG(value - 1);
else if ((value = apple_input_find_any_axis(index)))
BINDFOR(*self.setting).joyaxis = (value > 0) ? AXIS_POS(value - 1) : AXIS_NEG(abs(value) - 1);
else
return;