mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-11 11:15:28 +00:00
Added call to XAutoRepeatOff() to disable keyboard autorepeat on X11Input.
This commit is contained in:
parent
88f1ce081f
commit
9c98321c76
|
@ -425,43 +425,44 @@ namespace OpenTK.Platform.X11
|
|||
[DllImport("libX11")]
|
||||
public static extern void XSync(Display display, bool discard);
|
||||
|
||||
|
||||
[DllImport("libX11")]
|
||||
public static extern void XAutoRepeatOff(IntPtr display);
|
||||
|
||||
public static void SendNetWMMessage(X11WindowInfo window, IntPtr message_type, IntPtr l0, IntPtr l1, IntPtr l2)
|
||||
{
|
||||
XEvent xev;
|
||||
{
|
||||
XEvent xev;
|
||||
|
||||
xev = new XEvent();
|
||||
xev.ClientMessageEvent.type = XEventName.ClientMessage;
|
||||
xev.ClientMessageEvent.send_event = true;
|
||||
xev.ClientMessageEvent.window = window.WindowHandle;
|
||||
xev.ClientMessageEvent.message_type = message_type;
|
||||
xev.ClientMessageEvent.format = 32;
|
||||
xev.ClientMessageEvent.ptr1 = l0;
|
||||
xev.ClientMessageEvent.ptr2 = l1;
|
||||
xev.ClientMessageEvent.ptr3 = l2;
|
||||
xev = new XEvent();
|
||||
xev.ClientMessageEvent.type = XEventName.ClientMessage;
|
||||
xev.ClientMessageEvent.send_event = true;
|
||||
xev.ClientMessageEvent.window = window.WindowHandle;
|
||||
xev.ClientMessageEvent.message_type = message_type;
|
||||
xev.ClientMessageEvent.format = 32;
|
||||
xev.ClientMessageEvent.ptr1 = l0;
|
||||
xev.ClientMessageEvent.ptr2 = l1;
|
||||
xev.ClientMessageEvent.ptr3 = l2;
|
||||
|
||||
XSendEvent(window.Display, window.RootWindow, false,
|
||||
XSendEvent(window.Display, window.RootWindow, false,
|
||||
new IntPtr((int)(EventMask.SubstructureRedirectMask | EventMask.SubstructureNotifyMask)),
|
||||
ref xev);
|
||||
}
|
||||
}
|
||||
|
||||
public static void SendNetClientMessage(X11WindowInfo window, IntPtr message_type,
|
||||
public static void SendNetClientMessage(X11WindowInfo window, IntPtr message_type,
|
||||
IntPtr l0, IntPtr l1, IntPtr l2)
|
||||
{
|
||||
XEvent xev;
|
||||
{
|
||||
XEvent xev;
|
||||
|
||||
xev = new XEvent();
|
||||
xev.ClientMessageEvent.type = XEventName.ClientMessage;
|
||||
xev.ClientMessageEvent.send_event = true;
|
||||
xev.ClientMessageEvent.window = window.WindowHandle;
|
||||
xev.ClientMessageEvent.message_type = message_type;
|
||||
xev.ClientMessageEvent.format = 32;
|
||||
xev.ClientMessageEvent.ptr1 = l0;
|
||||
xev.ClientMessageEvent.ptr2 = l1;
|
||||
xev.ClientMessageEvent.ptr3 = l2;
|
||||
xev = new XEvent();
|
||||
xev.ClientMessageEvent.type = XEventName.ClientMessage;
|
||||
xev.ClientMessageEvent.send_event = true;
|
||||
xev.ClientMessageEvent.window = window.WindowHandle;
|
||||
xev.ClientMessageEvent.message_type = message_type;
|
||||
xev.ClientMessageEvent.format = 32;
|
||||
xev.ClientMessageEvent.ptr1 = l0;
|
||||
xev.ClientMessageEvent.ptr2 = l1;
|
||||
xev.ClientMessageEvent.ptr3 = l2;
|
||||
|
||||
XSendEvent(window.Display, window.WindowHandle, false, new IntPtr((int)EventMask.NoEventMask), ref xev);
|
||||
}
|
||||
XSendEvent(window.Display, window.WindowHandle, false, new IntPtr((int)EventMask.NoEventMask), ref xev);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,6 +78,8 @@ namespace OpenTK.Platform.X11
|
|||
keyboard.DeviceID = IntPtr.Zero;
|
||||
dummy_keyboard_list.Add(keyboard);
|
||||
|
||||
Functions.XAutoRepeatOff(window.Display);
|
||||
|
||||
Debug.Unindent();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue