[Gtk-sharp-list] Whiteboard application
Brad Taylor
brad at getcoded.net
Sat Jan 30 10:12:09 EST 2010
Hey,
> i'm developing a whiteboard application for using a Wiimote as mouse controller.
> I have almost do everything but i'm stuck on the problem about how to move the mouse cursor programmatically, send mouse input to all windows on desktop and so on.
> I know that "normal" c++ software can use this code:
>
> void fake_move(int x, int y)
> {
> Display* display = XOpenDisplay(0);
> XTestFakeMotionEvent(display, -1, x, y, 0);
> XCloseDisplay(display);
> DEBUG_MSG(4, "Mouse moved: %dx%d\n", x, y);
> }
>
>
>
> void fake_button(int button, bool pressed)
> {
> Display* display = XOpenDisplay(0);
> XTestFakeButtonEvent(display, button, pressed, 0);
> XCloseDisplay(display);
> DEBUG_MSG(4, "Mouse button #%d's state changed to %d\n", button,
> pressed); }
>
> but i don't know how if this "X" call are supported by the library or how to import and use this functions.
Check out http://lists.ximian.com/pipermail/gtk-sharp-list/2008-November/009202.html. You should be able to use Gdk.Display.WarpPointer to move the cursor, but I don't think that Gtk# is properly wrapping Gdk.Event, so there appears to be no way to construct a new event to feed to Gdk.Display.PutEvent. (However, this is just what I've figured out with ~3 minutes of googling, so I could be wrong.)
Best,
-Brad
More information about the Gtk-sharp-list
mailing list