From ae73c86b8fedd37620bb41f4762fd9eaae2e859a Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Sun, 5 Aug 2007 18:38:16 +0000 Subject: [PATCH] Trying to debug why Key events do not reach the X11Input window. --- Source/OpenTK/Platform/X11/X11Input.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/OpenTK/Platform/X11/X11Input.cs b/Source/OpenTK/Platform/X11/X11Input.cs index 60188589..b372a84d 100644 --- a/Source/OpenTK/Platform/X11/X11Input.cs +++ b/Source/OpenTK/Platform/X11/X11Input.cs @@ -20,7 +20,6 @@ namespace OpenTK.Platform.X11 KeyEvent keyEvent = new KeyEvent(); int pending; - #region --- Constructors --- /// @@ -77,8 +76,8 @@ namespace OpenTK.Platform.X11 Debug.WriteLine("done! (id: " + window + ")"); // Select input events to be reported here. - API.SelectInput(window.Display, window.Handle, - EventMask.KeyReleaseMask | EventMask.KeyPressMask); + //API.SelectInput(window.Display, window.Handle, + // EventMask.KeyReleaseMask | EventMask.KeyPressMask); keyboardDriver = new X11Keyboard(window); @@ -128,18 +127,20 @@ namespace OpenTK.Platform.X11 return; API.PeekEvent(window.Display, e); + Debug.Write(String.Format("Input window received {0} event... ", e.Type.ToString())); switch (e.Type) { case EventType.KeyPress: case EventType.KeyRelease: - Debug.WriteLine("Key event consumed"); API.NextEvent(window.Display, keyEvent); + Debug.WriteLine(" consumed!"); keyboardDriver.ProcessKeyboardEvent(keyEvent); break; default: API.NextEvent(window.Display, e); + Debug.WriteLine(" not consumed."); break; } }