Re: mouse motion events after pointer reached screen border



Hello David,

I think you could make the mouse pointer cursor invisible and when you detect a mouse movement (after you started somehow the "pan" process), just put the mouse in the original position: in this way you could move the mouse as long as you wish.

Using XLib in Linux, the code to set the mouse position could be:

       //
       //Place the mouse to the original position (i.e. to mPressPoint).
       Glib::RefPtr<Gdk::Window> lWin = get_window ();
       Window   win = GDK_WINDOW_XID (lWin->gobj ());
       Display *dpy = GDK_WINDOW_XDISPLAY (lWin->gobj ());
       XWarpPointer(dpy, None, win, 0, 0, 0, 0,
           mPressPoint.x,
           getWidgetSize ().y - mPressPoint.y - 1);

Hope this helps,
Luca

David Siegel wrote:

Hi,
I want to pan a bitmap in a drawing area. But I don't want the maximum
pan distance to be limited by the screen size. Is there any way to make
GTK emit mouse motion events after the pointer reached the screen border?

Thanks for your help,

       d

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]