Re: Pointer Warp
- From: Carsten Burstedde <c burstedde de>
- To: gtk-app-devel-list gnome org
- Subject: Re: Pointer Warp
- Date: Thu, 06 Jan 2005 23:54:13 +0100
I am considering writing a little game with gtk/gtkglext. Most part of
the (optionally fullscreen) window is a drawingarea. What can I do to
hide the cursor and get relative mouse events, regardless of window
borders and screen size, like it is possible in sdl or glut?
1. Create an empty cursor with gdk_cursor_new_from_pixmap()
and set it for the widget with
gdk_window_set_cursor(widget->window, empty_cursor).
Ok, I can try that.
2. Connect to "motion-notify-event", "button-press-event", or
"button-release-event" signal of the widget and use
event->x, event->y of the event passed to the signal handler
(if I understand wht you want).
The bad thing is that mouse motion stops at the edges of the screen. I
already tested XWarpPointer to bring it back to the center when
necessary which works somehow. But this breaks when a button is
pressed, then I do not get more motion/leave events. What can this be?
And, by the way, what is the XWarpPointer analogon on Windows?
Carsten
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]