Global Hotkey in Mono and Gtk#
I'm trying to get a global hotkey working in Linux using Mono. I found the signatures of XGrabKey and XUngrabKey , but I can't seem to get them working. Whenever I try to invoke XGrabKey , the application crashes with a SIGSEGV. This is what I have so far: using System; using Gtk; using System.Runtime.InteropServices; namespace GTKTest { class MainClass { const int GrabModeAsync = 1; public static void Main(string[] args) { Application.Init(); MainWindow win = new MainWindow(); win.Show(); // Crashes here XGrabKey( win.Display.Handle, (int)Gdk.Key.A, (uint)KeyMasks.ShiftMask, win.Handle, true,