sdlterm/src/sdlterm.cc
changeset 71 cfd3445107b4
parent 67 71f60bf6ebb7
child 72 6e0656600754
--- a/sdlterm/src/sdlterm.cc	Sun Jan 27 23:51:59 2013 +0100
+++ b/sdlterm/src/sdlterm.cc	Wed Jan 30 00:38:48 2013 +0100
@@ -462,9 +462,14 @@
                 if (_mousemove_last_x != event.mouse.x ||
                     _mousemove_last_y != event.mouse.y)
                 {
+                    if (_mousemove_last_x != -1)
+                    {
+                        event.mouse.relx = event.mouse.x - _mousemove_last_x;
+                        event.mouse.rely = event.mouse.y - _mousemove_last_y;
+                        event_ready = true;
+                    }
                     _mousemove_last_x = event.mouse.x;
                     _mousemove_last_y = event.mouse.y;
-                    event_ready = true;
                     break;
                 }
                 break; // continue loop when mouse position did not change