public XI2Mouse() { Debug.WriteLine("Using XI2Mouse."); using (new XLock(API.DefaultDisplay)) { window = new X11WindowInfo(); window.Display = API.DefaultDisplay; window.Screen = Functions.XDefaultScreen(window.Display); window.RootWindow = Functions.XRootWindow(window.Display, window.Screen); window.WindowHandle = window.RootWindow; } if (!IsSupported(window.Display)) { throw new NotSupportedException("XInput2 not supported."); } using (XIEventMask mask = new XIEventMask(1, XIEventMasks.RawButtonPressMask | XIEventMasks.RawButtonReleaseMask | XIEventMasks.RawMotionMask)) { Functions.XISelectEvents(window.Display, window.WindowHandle, mask); Functions.XISelectEvents(window.Display, window.RootWindow, mask); } }
public XI2MouseKeyboard() { window = new X11WindowInfo(); window.Display = Functions.XOpenDisplay(IntPtr.Zero); using (new XLock(window.Display)) { XSetWindowAttributes attr = new XSetWindowAttributes(); window.Screen = Functions.XDefaultScreen(window.Display); window.RootWindow = Functions.XRootWindow(window.Display, window.Screen); window.Handle = Functions.XCreateWindow(window.Display, window.RootWindow, 0, 0, 1, 1, 0, 0, CreateWindowArgs.InputOnly, IntPtr.Zero, SetWindowValuemask.Nothing, attr); KeyMap = new X11KeyMap(window.Display); } if (!IsSupported(window.Display)) { throw new NotSupportedException("XInput2 not supported."); } // Enable XI2 mouse/keyboard events // Note: the input event loop blocks waiting for these events // *or* a custom ClientMessage event that instructs us to exit. // See SendExitEvent() below. using (new XLock(window.Display)) using (XIEventMask mask = new XIEventMask(1, XIEventMasks.RawKeyPressMask | XIEventMasks.RawKeyReleaseMask | XIEventMasks.RawButtonPressMask | XIEventMasks.RawButtonReleaseMask | XIEventMasks.RawMotionMask | XIEventMasks.MotionMask | XIEventMasks.DeviceChangedMask)) { XI.SelectEvents(window.Display, window.RootWindow, mask); UpdateDevices(); } ProcessingThread = new Thread(ProcessEvents); ProcessingThread.IsBackground = true; ProcessingThread.Start(); }
public XI2Mouse() { using (new XLock(API.DefaultDisplay)) { this.window = new X11WindowInfo(); this.window.Display = API.DefaultDisplay; this.window.Screen = Functions.XDefaultScreen(this.window.Display); this.window.RootWindow = Functions.XRootWindow(this.window.Display, this.window.Screen); this.window.WindowHandle = this.window.RootWindow; } if (!XI2Mouse.IsSupported(this.window.Display)) { throw new NotSupportedException("XInput2 not supported."); } using (XIEventMask mask = new XIEventMask(1, (XIEventMasks)229376)) { Functions.XISelectEvents(this.window.Display, this.window.WindowHandle, mask); Functions.XISelectEvents(this.window.Display, this.window.RootWindow, mask); } }
public XI2MouseKeyboard() { window = new X11WindowInfo(); window.Display = Functions.XOpenDisplay(IntPtr.Zero); using (new XLock(window.Display)) { window.Screen = Functions.XDefaultScreen(window.Display); window.RootWindow = Functions.XRootWindow(window.Display, window.Screen); window.Handle = window.RootWindow; KeyMap = new X11KeyMap(window.Display); } if (!IsSupported(window.Display)) { throw new NotSupportedException("XInput2 not supported."); } using (new XLock(window.Display)) using (XIEventMask mask = new XIEventMask(1, XIEventMasks.RawKeyPressMask | XIEventMasks.RawKeyReleaseMask | XIEventMasks.RawButtonPressMask | XIEventMasks.RawButtonReleaseMask | XIEventMasks.RawMotionMask | XIEventMasks.MotionMask | XIEventMasks.DeviceChangedMask | (XIEventMasks)(1 << (int)ExitEvent))) { XI.SelectEvents(window.Display, window.Handle, mask); UpdateDevices(); } ProcessingThread = new Thread(ProcessEvents); ProcessingThread.IsBackground = true; ProcessingThread.Start(); }
public XI2MouseKeyboard() { window = new X11WindowInfo(); window.Display = Functions.XOpenDisplay(IntPtr.Zero); using (new XLock(window.Display)) { XSetWindowAttributes attr = new XSetWindowAttributes(); window.Screen = Functions.XDefaultScreen(window.Display); window.RootWindow = Functions.XRootWindow(window.Display, window.Screen); window.Handle = Functions.XCreateWindow(window.Display, window.RootWindow, 0, 0, 1, 1, 0, 0, CreateWindowArgs.InputOnly, IntPtr.Zero, SetWindowValuemask.Nothing, attr); KeyMap = new X11KeyMap(window.Display); } if (!IsSupported(window.Display)) throw new NotSupportedException("XInput2 not supported."); // Enable XI2 mouse/keyboard events // Note: the input event loop blocks waiting for these events // *or* a custom ClientMessage event that instructs us to exit. // See SendExitEvent() below. using (new XLock(window.Display)) using (XIEventMask mask = new XIEventMask(1, XIEventMasks.RawKeyPressMask | XIEventMasks.RawKeyReleaseMask | XIEventMasks.RawButtonPressMask | XIEventMasks.RawButtonReleaseMask | XIEventMasks.RawMotionMask | XIEventMasks.MotionMask | XIEventMasks.DeviceChangedMask)) { XI.SelectEvents(window.Display, window.RootWindow, mask); UpdateDevices(); } ProcessingThread = new Thread(ProcessEvents); ProcessingThread.IsBackground = true; ProcessingThread.Start(); }
static extern Status XIGrabDevice(IntPtr display, int deviceid, Window grab_window, Time time, Cursor cursor, int grab_mode, int paired_device_mode, Bool owner_events, XIEventMask[] mask);
public static int XISelectEvents(IntPtr dpy, Window win, XIEventMask mask) { return XISelectEvents(dpy, win, ref mask, 1); }
public static int XISelectEvents(IntPtr dpy, Window win, XIEventMask[] masks) { return XISelectEvents(dpy, win, masks, masks.Length); }
public static int XISelectEvents(IntPtr dpy, Window win, XIEventMask mask) { return(XISelectEvents(dpy, win, ref mask, 1)); }
static extern int XISelectEvents(IntPtr dpy, Window win, [In] ref XIEventMask masks, int num_masks);
public XI2MouseKeyboard() { window = new X11WindowInfo(); window.Display = Functions.XOpenDisplay(IntPtr.Zero); using (new XLock(window.Display)) { window.Screen = Functions.XDefaultScreen(window.Display); window.RootWindow = Functions.XRootWindow(window.Display, window.Screen); window.Handle = window.RootWindow; KeyMap = new X11KeyMap(window.Display); } if (!IsSupported(window.Display)) throw new NotSupportedException("XInput2 not supported."); using (new XLock(window.Display)) using (XIEventMask mask = new XIEventMask(1, XIEventMasks.RawKeyPressMask | XIEventMasks.RawKeyReleaseMask | XIEventMasks.RawButtonPressMask | XIEventMasks.RawButtonReleaseMask | XIEventMasks.RawMotionMask | XIEventMasks.MotionMask | XIEventMasks.DeviceChangedMask | (XIEventMasks)(1 << (int)ExitEvent))) { XI.SelectEvents(window.Display, window.Handle, mask); UpdateDevices(); } ProcessingThread = new Thread(ProcessEvents); ProcessingThread.IsBackground = true; ProcessingThread.Start(); }
public static int XISelectEvents(IntPtr dpy, IntPtr win, XIEventMask mask) { return(Functions.XISelectEvents(dpy, win, ref mask, 1)); }
private static int XISelectEvents(IntPtr dpy, IntPtr win, [In] ref XIEventMask masks, int num_masks);
private static int XIGrabDevice(IntPtr display, int deviceid, IntPtr grab_window, IntPtr time, IntPtr cursor, int grab_mode, int paired_device_mode, bool owner_events, XIEventMask[] mask);
public static int XISelectEvents(IntPtr dpy, IntPtr win, XIEventMask mask) { return Functions.XISelectEvents(dpy, win, ref mask, 1); }
public static int XISelectEvents(IntPtr dpy, IntPtr win, XIEventMask[] masks) { return Functions.XISelectEvents(dpy, win, masks, masks.Length); }