diff render_sdl.c @ 1861:fc05f49075c2

Reprocess bindings when SDL2 mappings, controller types or controller order change
author Michael Pavone <pavone@retrodev.com>
date Fri, 03 May 2019 18:56:12 -0700
parents bdca98187c9f
children e07fc3d473b2
line wrap: on
line diff
--- a/render_sdl.c	Fri May 03 18:40:13 2019 -0700
+++ b/render_sdl.c	Fri May 03 18:56:12 2019 -0700
@@ -950,6 +950,11 @@
 	joysticks[desired_index] = tmp_joy;
 	joystick_sdl_index[desired_index] = tmp_index;
 	joystick_index_locked[desired_index] = 1;
+	//update bindings as the controllers being swapped may have different mappings
+	handle_joy_added(desired_index);
+	if (joysticks[joystick]) {
+		handle_joy_added(joystick);
+	}
 	return desired_index;
 }