Work on X11 mouse driver.

This commit is contained in:
the_fiddler 2007-09-24 20:10:14 +00:00
parent 0e862bcfdf
commit 130951343a
3 changed files with 26 additions and 14 deletions

View file

@ -16,12 +16,5 @@ namespace OpenTK.Input
/// Gets the list of available mouse devices. /// Gets the list of available mouse devices.
/// </summary> /// </summary>
IList<Mouse> Mouse { get; } IList<Mouse> Mouse { get; }
/*
/// <summary>
/// Registers available mouse devices.
/// </summary>
/// <returns>The number of devices registered.</returns>
int RegisterDevices();
*/
} }
} }

View file

@ -17,19 +17,18 @@ using System.Diagnostics;
namespace OpenTK.Platform.X11 namespace OpenTK.Platform.X11
{ {
/// <summary> /// <summary>
/// Drives the Keyboard devices on X11. /// Drives Keyboard devices on X11.
/// This class supports OpenTK, and is not intended for use by OpenTK programs. /// This class supports OpenTK, and is not intended for use by OpenTK programs.
/// </summary> /// </summary>
internal class X11Keyboard : IKeyboardDriver internal sealed class X11Keyboard : IKeyboardDriver
{ {
/// <summary> /// <summary>
/// The window receiving input events. /// The window receiving input events.
/// </summary> /// </summary>
WindowInfo window; WindowInfo window;
private bool[] keys = new bool[(int)OpenTK.Input.Key.MaxKeys]; List<Keyboard> keyboards = new List<Keyboard>();
private List<Keyboard> keyboards = new List<Keyboard>(); static Dictionary<XKey, Key> keymap = new Dictionary<XKey, Key>((int)Key.MaxKeys);
private static Dictionary<XKey, Key> keymap = new Dictionary<XKey, Key>((int)Key.MaxKeys);
/// <summary> /// <summary>
/// The smallest and largest KeyCode supported by the X server. Queried through API.DisplayKeycodes() /// The smallest and largest KeyCode supported by the X server. Queried through API.DisplayKeycodes()
/// </summary> /// </summary>
@ -162,6 +161,8 @@ namespace OpenTK.Platform.X11
#endregion #endregion
#region Constructor
internal X11Keyboard(WindowInfo window) internal X11Keyboard(WindowInfo window)
{ {
if (window == null) if (window == null)
@ -193,6 +194,8 @@ namespace OpenTK.Platform.X11
Debug.Print("Keyboard added: {0}", kb.ToString()); Debug.Print("Keyboard added: {0}", kb.ToString());
} }
#endregion
#region internal bool ProcessKeyboardEvent(X11.KeyEvent e) #region internal bool ProcessKeyboardEvent(X11.KeyEvent e)
/// <summary> /// <summary>

View file

@ -11,13 +11,29 @@ using OpenTK.Input;
namespace OpenTK.Platform.X11 namespace OpenTK.Platform.X11
{ {
class X11Mouse : IMouseDriver /// <summary>
/// Drives Mouse devices on X11.
/// This class supports OpenTK, and is not intended for use by OpenTK programs.
/// </summary>
internal sealed class X11Mouse : IMouseDriver
{ {
WindowInfo window;
List<Mouse> mice = new List<Mouse>();
#region Constructor
public X11Mouse(WindowInfo window)
{
this.window = window;
}
#endregion
#region --- IMouseDriver Members --- #region --- IMouseDriver Members ---
public IList<Mouse> Mouse public IList<Mouse> Mouse
{ {
get { throw new Exception("The method or operation is not implemented."); } get { }
} }
public int RegisterDevices() public int RegisterDevices()