Slightly changed debug output on Create event (X11GLNative)

Corrected event hooking in X11Input.
This commit is contained in:
the_fiddler 2007-08-05 18:33:38 +00:00
parent 6ccbfb266e
commit 4c0b710fa6
2 changed files with 17 additions and 1 deletions

View file

@ -283,8 +283,8 @@ namespace OpenTK.Platform.X11
{
if (this.Create != null)
{
Debug.Print("Create event fired from window: {0}", info.ToString());
this.Create(this, e);
Debug.Print("OnCreate fired, from window: {0}", info.ToString());
}
}

View file

@ -18,6 +18,7 @@ namespace OpenTK.Platform.X11
Event e = new Event();
KeyEvent keyEvent = new KeyEvent();
int pending;
#region --- Constructors ---
@ -115,16 +116,31 @@ namespace OpenTK.Platform.X11
#endregion
/// <summary>
/// Consumes to keyboard, mouse, etc events, routing them to their
/// respective drivers.
/// </summary>
public void ProcessEvents()
{
pending = API.Pending(window.Display);
if (pending == 0)
return;
API.PeekEvent(window.Display, e);
switch (e.Type)
{
case EventType.KeyPress:
case EventType.KeyRelease:
Debug.WriteLine("Key event consumed");
API.NextEvent(window.Display, keyEvent);
keyboardDriver.ProcessKeyboardEvent(keyEvent);
break;
default:
API.NextEvent(window.Display, e);
break;
}
}