From 387f455078bf9e8c422ef2199ae8b8f1773cbcb1 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Sun, 5 Aug 2007 17:21:46 +0000 Subject: [PATCH] Updated X11/X11Input.cs and X11/X11Keyboard.cs. The input window is now a child of the main window, and X11Keyboard now gets the keysym/keycode info. --- Source/OpenTK/Platform/X11/X11Input.cs | 8 +++++++- Source/OpenTK/Platform/X11/X11Keyboard.cs | 3 +-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Source/OpenTK/Platform/X11/X11Input.cs b/Source/OpenTK/Platform/X11/X11Input.cs index 785604b9..353cae8a 100644 --- a/Source/OpenTK/Platform/X11/X11Input.cs +++ b/Source/OpenTK/Platform/X11/X11Input.cs @@ -17,6 +17,12 @@ namespace OpenTK.Platform.X11 #region --- Constructors --- + /// + /// Constructs a new X11Input driver. Creates a hidden InputOnly window, child to + /// the main application window, which selects input events and routes them to + /// the device specific drivers (Keyboard, Mouse, Hid). + /// + /// public X11Input(WindowInfo parent) { Debug.WriteLine("Initalizing X11 input driver."); @@ -37,7 +43,7 @@ namespace OpenTK.Platform.X11 window.Handle = API.CreateWindow( window.Display, - window.RootWindow, + window.Parent.Handle, 0, 0, 1, 1, 0, diff --git a/Source/OpenTK/Platform/X11/X11Keyboard.cs b/Source/OpenTK/Platform/X11/X11Keyboard.cs index ba157ed9..9f013568 100644 --- a/Source/OpenTK/Platform/X11/X11Keyboard.cs +++ b/Source/OpenTK/Platform/X11/X11Keyboard.cs @@ -100,7 +100,6 @@ namespace OpenTK.Platform.X11 internal X11Keyboard(WindowInfo window) { - /* this.window = window; Initialize(); @@ -113,7 +112,7 @@ namespace OpenTK.Platform.X11 //keysyms = (IntPtr[])Marshal.PtrToStructure(keysym_ptr, typeof(IntPtr[])); API.Free(keysym_ptr); - */ + Keyboard kb = new Keyboard(); kb.Description = "Default X11 keyboard"; kb.NumberOfKeys = lastKeyCode - firstKeyCode + 1;