#Description: Use absolute mouse position. Index: qonk-0.3.1/src/game.cpp =================================================================== --- qonk-0.3.1.orig/src/game.cpp 2009-04-10 13:00:28.000000000 -0400 +++ qonk-0.3.1/src/game.cpp 2009-04-10 13:02:20.000000000 -0400 @@ -178,6 +178,14 @@ if (value) setFleetStrength(1); break; + case GA_MOVE_CURSOR_H: + if(value) + x = value; + break; + case GA_MOVE_CURSOR_V: + if(value) + y = value; + break; case GA_CURSOR_UP: yn = value; break; Index: qonk-0.3.1/src/input.h =================================================================== --- qonk-0.3.1.orig/src/input.h 2009-04-10 13:01:05.000000000 -0400 +++ qonk-0.3.1/src/input.h 2009-04-10 13:02:20.000000000 -0400 @@ -53,6 +53,9 @@ GA_SELECTION, + GA_MOVE_CURSOR_H, + GA_MOVE_CURSOR_V, + GA_CURSOR_UP, GA_CURSOR_DOWN, GA_CURSOR_LEFT, Index: qonk-0.3.1/src/sdl_driver.cpp =================================================================== --- qonk-0.3.1.orig/src/sdl_driver.cpp 2009-04-10 13:01:22.000000000 -0400 +++ qonk-0.3.1/src/sdl_driver.cpp 2009-04-10 13:02:20.000000000 -0400 @@ -217,23 +217,23 @@ if (ev.motion.xrel <= -DEADZONE_MOUSE) { - input(IT_MOUSEMOTION, 0, AD_NEGATIVE, 0, -ev.motion.xrel); + input(IT_MOUSEMOTION, 0, 0, 0, ev.motion.x); mouseXNeg = MOVED; } else if(ev.motion.xrel >= DEADZONE_MOUSE) { - input(IT_MOUSEMOTION, 0, AD_POSITIVE, 0, ev.motion.xrel); + input(IT_MOUSEMOTION, 0, 0, 0, ev.motion.x); mouseXPos = MOVED; } if (ev.motion.yrel <= -DEADZONE_MOUSE) { - input(IT_MOUSEMOTION, 1, AD_NEGATIVE, 0, -ev.motion.yrel); + input(IT_MOUSEMOTION, 1, 0, 0, ev.motion.y); mouseYNeg = MOVED; } else if(ev.motion.yrel >= DEADZONE_MOUSE) { - input(IT_MOUSEMOTION, 1, AD_POSITIVE, 0, ev.motion.yrel); + input(IT_MOUSEMOTION, 1, 0, 0, ev.motion.y); mouseYPos = MOVED; } @@ -263,7 +263,7 @@ // like a key or joystick axis where releases and non-movement can be detected. if (mouseXNeg == RESET_NEEDED) { - input(IT_MOUSEMOTION, 0, AD_NEGATIVE, 0, 0); + input(IT_MOUSEMOTION, 0, 0, 0, 0); mouseXNeg = INITIAL; } else if (mouseXNeg == MOVED) @@ -271,7 +271,7 @@ if (mouseXPos == RESET_NEEDED) { - input(IT_MOUSEMOTION, 0, AD_POSITIVE, 0, 0); + input(IT_MOUSEMOTION, 0, 0, 0, 0); mouseXPos = INITIAL; } else if (mouseXPos == MOVED) @@ -279,7 +279,7 @@ if (mouseYNeg == RESET_NEEDED) { - input(IT_MOUSEMOTION, 1, AD_NEGATIVE, 0, 0); + input(IT_MOUSEMOTION, 1, 0, 0, 0); mouseYNeg = INITIAL; } else if (mouseYNeg == MOVED) @@ -287,7 +287,7 @@ if (mouseYPos == RESET_NEEDED) { - input(IT_MOUSEMOTION, 1, AD_POSITIVE, 0, 0); + input(IT_MOUSEMOTION, 1, 0, 0, 0); mouseYPos = INITIAL; } else if (mouseYPos == MOVED) Index: qonk-0.3.1/src/settings.cpp =================================================================== --- qonk-0.3.1.orig/src/settings.cpp 2009-04-10 13:01:42.000000000 -0400 +++ qonk-0.3.1/src/settings.cpp 2009-04-10 13:02:20.000000000 -0400 @@ -66,6 +66,8 @@ // Those are fixed and not supposed to be changed via a config file. set(GA_TOGGLE_GRAB, IT_KEYBOARD, SDLK_g, 0, 0); set(GA_LEAVE, IT_KEYBOARD, SDLK_ESCAPE, 0, 0); + set(GA_MOVE_CURSOR_H, IT_MOUSEMOTION, 0, 0 , 0); + set(GA_MOVE_CURSOR_V, IT_MOUSEMOTION, 1, 0 , 0); const lisp::Lisp* root = 0; @@ -308,6 +310,8 @@ subReader->get("axis", id0); subReader->get("direction", id1); id2 = 0; + if(id0 == 0 || id0 == 1) + id0 = -1; //ignore old bindings for mouse movement } else if (inputTypeName == "mousebutton") { @@ -489,16 +493,12 @@ set(GA_MOVE_TO_NEAREST_PLANET, IT_MOUSEBUTTON, SDL_BUTTON_RIGHT, 0, 0); set(GA_MOVE_TO_NEAREST_PLANET, IT_KEYBOARD, SDLK_LCTRL, 0, 0); - set(GA_CURSOR_LEFT, IT_MOUSEMOTION, 0, AD_NEGATIVE, 0); set(GA_CURSOR_LEFT, IT_KEYBOARD, SDLK_LEFT, 0, 0); - set(GA_CURSOR_RIGHT, IT_MOUSEMOTION, 0, AD_POSITIVE, 0); set(GA_CURSOR_RIGHT, IT_KEYBOARD, SDLK_RIGHT, 0, 0); - set(GA_CURSOR_UP, IT_MOUSEMOTION, 1, AD_NEGATIVE, 0); set(GA_CURSOR_UP, IT_KEYBOARD, SDLK_UP, 0, 0); - set(GA_CURSOR_DOWN, IT_MOUSEMOTION, 1, AD_POSITIVE, 0); set(GA_CURSOR_DOWN, IT_KEYBOARD, SDLK_DOWN, 0, 0); /* preliminary: cursor control with joystick - works good