public extern static Bool XCheckTypedWindowEvent(Display display, Window w, XEventName event_type, ref XEvent event_return);
private void GenerateMessage (VirtualKeys vkey, int scan, int key_code, XEventName type, int event_time) { bool state = (vkey == VirtualKeys.VK_NUMLOCK ? num_state : cap_state); KeybdEventFlags up, down; if (state) { // The INTERMEDIARY state means : just after a 'press' event, if a 'release' event comes, // don't treat it. It's from the same key press. Then the state goes to ON. // And from there, a 'release' event will switch off the toggle key. SetState (vkey, false); } else { down = (vkey == VirtualKeys.VK_NUMLOCK ? KeybdEventFlags.ExtendedKey : KeybdEventFlags.None); up = (vkey == VirtualKeys.VK_NUMLOCK ? KeybdEventFlags.ExtendedKey : KeybdEventFlags.None) | KeybdEventFlags.KeyUp; if ((key_state_table [(int) vkey] & 0x1) != 0) { // it was on if (type != XEventName.KeyPress) { SendKeyboardInput (vkey, scan, key_code, down, event_time); SendKeyboardInput (vkey, scan, key_code, up, event_time); SetState (vkey, false); key_state_table [(int) vkey] &= unchecked ((byte) ~0x01); } } else { if (type == XEventName.KeyPress) { SendKeyboardInput (vkey, scan, key_code, down, event_time); SendKeyboardInput (vkey, scan, key_code, up, event_time); SetState (vkey, true); key_state_table [(int) vkey] |= 0x01; } } } }
public extern static Bool XCheckTypedEvent(Display display, XEventName event_type, out XEvent event_return);
public extern static bool XCheckTypedWindowEvent(IntPtr x11display, IntPtr x11window, XEventName event_type, ref XEvent x11event);
public static bool XCheckTypedEvent(IntPtr display, XEventName event_type, out XEvent event_return);
public static bool XCheckTypedWindowEvent(IntPtr display, IntPtr w, XEventName event_type, ref XEvent event_return);