- // TODO make a screen out of this, another mainloop is ugly
- main_controller->update();
-+ secondary_controller->update();
- SDL_Event event;
- while (SDL_PollEvent(&event)) {
- main_controller->process_event(event);
-+ secondary_controller->process_event(event);
- if(event.type == SDL_QUIT)
- main_loop->quit();
- }
-Index: src/mainloop.cpp
-===================================================================
---- src/mainloop.cpp (revision 5235)
-+++ src/mainloop.cpp (working copy)
-@@ -177,9 +177,11 @@
+ const lisp::Lisp* config_addons_lisp = config_lisp->get_lisp("addons");
+ if(config_addons_lisp) {
+@@ -152,6 +156,11 @@ Config::save()
+ main_controller->write(writer);
+ writer.end_list("control");
+ }
++ if(secondary_controller) {
++ writer.start_list("control-p2");
++ secondary_controller->write(writer);
++ writer.end_list("control-p2");
++ }
+
+ writer.start_list("addons");
+ AddonManager::get_instance().write_config(writer);
+diff --git a/src/main.cpp b/src/main.cpp
+index fedbe0c..af6dfb6 100644
+--- a/src/main.cpp
++++ b/src/main.cpp
+@@ -65,6 +65,7 @@ namespace supertux_apple {
+ namespace { DrawingContext *context_pointer; }
+ SDL_Surface *screen;
+ JoystickKeyboardController* main_controller = 0;
++JoystickKeyboardController* secondary_controller = 0;
+ TinyGetText::DictionaryManager dictionary_manager;
+
+ int SCREEN_WIDTH;
+@@ -541,6 +542,7 @@ int main(int argc, char** argv)
+
+ timelog("controller");
+ main_controller = new JoystickKeyboardController();
++ secondary_controller = new JoystickKeyboardController();
+
+ timelog("config");
+ init_config();
+@@ -629,7 +631,9 @@ int main(int argc, char** argv)
+ delete config;
+ config = NULL;
+ delete main_controller;
++ delete secondary_controller;
+ main_controller = NULL;
++ secondary_controller = NULL;
+ delete Console::instance;
+ Console::instance = NULL;
+ Scripting::exit_squirrel();
+diff --git a/src/main.hpp b/src/main.hpp
+index 92c1752..917c7f2 100644
+--- a/src/main.hpp
++++ b/src/main.hpp
+@@ -36,5 +36,6 @@ extern int SCREEN_HEIGHT;
+ // global variables
+ class JoystickKeyboardController;
+ extern JoystickKeyboardController* main_controller;
++extern JoystickKeyboardController* secondary_controller;
+
+ #endif
+diff --git a/src/mainloop.cpp b/src/mainloop.cpp
+index ca6ba5e..402737f 100644
+--- a/src/mainloop.cpp
++++ b/src/mainloop.cpp
+@@ -180,11 +180,13 @@ void