int InvokeNative(Atk.KeyEventStruct evnt) { IntPtr native_evnt = GLib.Marshaller.StructureToPtrAlloc(evnt); int __result = native_cb(native_evnt, __data); Marshal.FreeHGlobal(native_evnt); return(__result); }
public bool HandleKey(Atk.KeyEventStruct evnt) { if (KeyListenerList.Count == 0) { return(false); } foreach (KeyValuePair <uint, KeyListenerInfo> kvp in KeyListenerList) { int result = 0; AutoResetEvent sync = GLibHacks.Invoke(delegate(object sender, EventArgs args) { result = kvp.Value.listener(evnt); }); sync.WaitOne(); sync.Close(); sync = null; if (result != 0) { return(true); } } return(false); }