src/control/joystickkeyboardcontroller.cpp: Add SDL 1.3 compatibility code.
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Thu, 14 Jan 2010 17:41:14 +0000 (18:41 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sun, 21 Feb 2010 07:58:50 +0000 (08:58 +0100)
src/control/joystickkeyboardcontroller.cpp

index 761c6a0..fa7d75f 100644 (file)
@@ -186,7 +186,12 @@ JoystickKeyboardController::read(const Reader& lisp)
         const lisp::Lisp* map = iter.lisp();
         map->get("key", key);
         map->get("control", control);
-        if(key < SDLK_FIRST || key >= SDLK_LAST) {
+#if SDL_VERSION_ATLEAST(1,3,0)
+       if(key < 0)
+#else
+        if(key < SDLK_FIRST || key >= SDLK_LAST)
+#endif
+       {
           log_info << "Invalid key '" << key << "' in keymap" << std::endl;
           continue;
         }