Index: director.py
===================================================================
--- director.py	(revision 880)
+++ director.py	(working copy)
@@ -420,7 +420,25 @@
 
         return ( int( x_diff * x) - adjust_x,   int( y_diff * y ) - adjust_y )
 
+    def get_virtual_displacement( self, dx, dy ):
+        """Transforms a displacement in *real* window coordinates, to the
+        equivalent in *virtual* window coordinates.
+        
+        For example, if you created a window of 640x480, and it was
+        resized to 640x1000, then if you move your mouse over that
+        window, you will get displacements that match to the newly
+        resized window.  Probably you are not interested in those
+        values, but in the scaled displacement that belongs to your
+        *virtual* window.
 
+        :rtype: (dx,dy)
+        :returns: Transformed displacment from the *real* window to the *virtual* window
+        """
+        x_scale = self._window_original_width / float( self.window.width - self._offset_x * 2 )
+        y_scale = self._window_original_height / float( self.window.height - self._offset_y * 2 )
+
+        return (x_scale * dx, y_scale * dy)
+
     def scaled_resize_window( self, width, height):
         """One of two possible methods that are called when the main window is resized.
 
