[ Return to Bugs & Features | Roadmap 2.0 | Post Text | Post File ]
|Status:||5 - New|
|Priority:||1 - Request for Enhancement, e.g. asking for a feature|
|Scope:||3 - Applies to all machines and operating systems|
Trouble Report Files:
[ Post File ]
Trouble Report Comments:
[ Post Text ]
02:40 Jul 06, 2007
|I'm looking for a way to repositioning the mouse cursor. |
I need this feature to implement the fly mode in a openGL window in order to allow the camera rotation caturing the mouse movement events.
The problem is that when mouse cursor hit the border of the screen it does not generate any other useful event to track the mouse movement.
That is, I continue to move mouse but the cursor coordinate offset does not change from 0 (because mouse cursor keep it's position on the screen).
So I used to place the cursor at the center of the capturing window at every event, hidding the cursor itself, and monitoring the offset from the center of the render window.
Actually I've to do this calling a X or Win32 API directly intead of using an FLTK call.
Somebody has posted this solution at http://email@example.com/msg00023.html , in which he propose the function jump_mouse as
int jump_cursor (int new_x, int new_y)
#if defined WIN32
BOOL result = SetCursorPos(new_x, new_y);
if (result) return 0; // OK
#elif defined __APPLE__
new_pos.x = new_x;
new_pos.y = new_y;
err = CGWarpMouseCursorPosition(new_pos);
if (!err) return 0; // OK
#else // Assume this is Xlib
Window rootwindow = DefaultRootWindow(fl_display);
XWarpPointer(fl_display, rootwindow, rootwindow, 0, 0, 0, 0,
return 0; // Assume OK
return -1; // Fail
} // jump_cursor
Would be nice if it could be tested and integrated in the next version of fltk...
[ Return to Bugs & Features | Post Text | Post File ]