Corrected an invalid cast exception in X11Keyboard constructor.

This commit is contained in:
the_fiddler 2007-08-05 16:26:01 +00:00
parent 2b7f7bbc24
commit 8f5fc9cdd8

View file

@ -107,17 +107,20 @@ namespace OpenTK.Platform.X11
IntPtr keysym_ptr = API.GetKeyboardMapping(window.Display, (byte)firstKeyCode, IntPtr keysym_ptr = API.GetKeyboardMapping(window.Display, (byte)firstKeyCode,
lastKeyCode - firstKeyCode + 1, ref keysyms_per_keycode); lastKeyCode - firstKeyCode + 1, ref keysyms_per_keycode);
keysyms = (IntPtr[])Marshal.PtrToStructure(keysym_ptr, typeof(IntPtr[])); keysyms = new IntPtr[(lastKeyCode - firstKeyCode + 1) * keysyms_per_keycode];
Marshal.PtrToStructure(keysym_ptr, keysyms);
//keysyms = (IntPtr[])Marshal.PtrToStructure(keysym_ptr, typeof(IntPtr[]));
API.Free(keysym_ptr); API.Free(keysym_ptr);
} }
#region internal bool ProcessKeyboardEvent(API.RawInput rin) #region internal bool ProcessKeyboardEvent(API.RawInput rin)
/// <summary> /// <summary>
/// Processes raw input events. /// Processes X11 KeyEvents.
/// </summary> /// </summary>
/// <param name="rin"></param> /// <param name="e">The X11.KeyEvent to process</param>
/// <returns></returns> /// <returns>True if the event was processed, false otherwise.</returns>
internal bool ProcessKeyboardEvent(X11.KeyEvent e) internal bool ProcessKeyboardEvent(X11.KeyEvent e)
{ {
return false; return false;