Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set cursor position in gtk -Linux, MonoDevelop

Okay, so I thought I would get into Linux development. However, I found that you cant hardly manipulate the mouse and keyboard. My question is does GTK not support that sort of thing, or am I missing something?

In windows its easy:

Point Pos = new Point(20,20);
    Cursor.Position = Pos;

How would I do that in Linux? I'm using MonoDevelop. Thanks!

like image 972
FrostyFire Avatar asked May 24 '13 03:05

FrostyFire


1 Answers

Since you mention using MonoDevelop on Linux, I assume you are using Gtk#. Using Gtk#, you need to use Gdk.Display.WarpPointer. Untested, but probably something like the following would work:

Gdk.Display.Default.WarpPointer(Gdk.Display.DefaultScreen, 20, 20);
like image 113
Pete Avatar answered Oct 05 '22 20:10

Pete