Qt: Update actual bindings after using menu items.

This commit is contained in:
BearOso 2023-11-30 17:12:42 -06:00
parent 7dcae9d56d
commit b8d71c6562
1 changed files with 6 additions and 0 deletions

View File

@ -93,6 +93,7 @@ void ControllerPanel::autoPopulateWithKeyboard(int slot)
buttons[app->config->allowed_bindings * i + slot] = EmuBinding::keyboard(QKeySequence::fromString(button_list[i])[0].key()); buttons[app->config->allowed_bindings * i + slot] = EmuBinding::keyboard(QKeySequence::fromString(button_list[i])[0].key());
fillTable(); fillTable();
app->updateBindings();
} }
void ControllerPanel::autoPopulateWithJoystick(int joystick_id, int slot) void ControllerPanel::autoPopulateWithJoystick(int joystick_id, int slot)
@ -124,6 +125,7 @@ void ControllerPanel::autoPopulateWithJoystick(int joystick_id, int slot)
buttons[4 * i + slot] = EmuBinding::joystick_axis(device.index, sdl_binding.value.axis, sdl_binding.value.axis); buttons[4 * i + slot] = EmuBinding::joystick_axis(device.index, sdl_binding.value.axis, sdl_binding.value.axis);
} }
fillTable(); fillTable();
app->updateBindings();
} }
void ControllerPanel::swapControllers(int first, int second) void ControllerPanel::swapControllers(int first, int second)
@ -138,6 +140,8 @@ void ControllerPanel::swapControllers(int first, int second)
b[i] = a[i]; b[i] = a[i];
a[i] = swap; a[i] = swap;
} }
app->updateBindings();
} }
void ControllerPanel::clearCurrentController() void ControllerPanel::clearCurrentController()
@ -146,6 +150,7 @@ void ControllerPanel::clearCurrentController()
for (auto &b : c.buttons) for (auto &b : c.buttons)
b = {}; b = {};
fillTable(); fillTable();
app->updateBindings();
} }
void ControllerPanel::clearAllControllers() void ControllerPanel::clearAllControllers()
@ -154,6 +159,7 @@ void ControllerPanel::clearAllControllers()
for (auto &b : c.buttons) for (auto &b : c.buttons)
b = {}; b = {};
fillTable(); fillTable();
app->updateBindings();
} }
void ControllerPanel::showEvent(QShowEvent *event) void ControllerPanel::showEvent(QShowEvent *event)