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.

This commit is contained in:
the_fiddler 2007-08-05 17:21:46 +00:00
parent 3e47153aa4
commit 387f455078
2 changed files with 8 additions and 3 deletions

View file

@ -17,6 +17,12 @@ namespace OpenTK.Platform.X11
#region --- Constructors --- #region --- Constructors ---
/// <summary>
/// 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).
/// </summary>
/// <param name="parent"></param>
public X11Input(WindowInfo parent) public X11Input(WindowInfo parent)
{ {
Debug.WriteLine("Initalizing X11 input driver."); Debug.WriteLine("Initalizing X11 input driver.");
@ -37,7 +43,7 @@ namespace OpenTK.Platform.X11
window.Handle = API.CreateWindow( window.Handle = API.CreateWindow(
window.Display, window.Display,
window.RootWindow, window.Parent.Handle,
0, 0, 0, 0,
1, 1, 1, 1,
0, 0,

View file

@ -100,7 +100,6 @@ namespace OpenTK.Platform.X11
internal X11Keyboard(WindowInfo window) internal X11Keyboard(WindowInfo window)
{ {
/*
this.window = window; this.window = window;
Initialize(); Initialize();
@ -113,7 +112,7 @@ namespace OpenTK.Platform.X11
//keysyms = (IntPtr[])Marshal.PtrToStructure(keysym_ptr, typeof(IntPtr[])); //keysyms = (IntPtr[])Marshal.PtrToStructure(keysym_ptr, typeof(IntPtr[]));
API.Free(keysym_ptr); API.Free(keysym_ptr);
*/
Keyboard kb = new Keyboard(); Keyboard kb = new Keyboard();
kb.Description = "Default X11 keyboard"; kb.Description = "Default X11 keyboard";
kb.NumberOfKeys = lastKeyCode - firstKeyCode + 1; kb.NumberOfKeys = lastKeyCode - firstKeyCode + 1;