How to set cursor position in gtk-Linux, MonoDevelop

Ok, so I thought I was going to develop Linux. However, I found that you cannot manipulate the mouse and keyboard. My question is, does GTK not support this kind of thing, or am I missing something?

In windows it is easy:

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

How do I do this on Linux? I am using MonoDevelop. Thanks!

+6
source share
1 answer

Since you mention the use of MonoDevelop on Linux, I assume you are using Gtk # . Using Gtk #, you need to use Gdk.Display.WarpPointer . Unverified, but maybe something like the following:

 Gdk.Display.Default.WarpPointer(Gdk.Display.DefaultScreen, 20, 20); 
+6
source

Source: https://habr.com/ru/post/945742/


All Articles