Permalink
Browse files

[X11] Implemented modifier keys

  • Loading branch information...
1 parent 9ba21d6 commit ee1fb2a917f9f38d7fd0a85dd2e021872010de4d @thefiddler thefiddler committed Feb 17, 2014
Showing with 5 additions and 3 deletions.
  1. +5 −3 Source/OpenTK/Platform/X11/X11GLNative.cs
@@ -849,24 +849,26 @@ public void ProcessEvents()
Key key;
if (driver.TranslateKey(ref e.KeyEvent, out key))
{
+ // Update legacy GameWindow.Keyboard API:
+ keyboard.SetKey(key, (uint)e.KeyEvent.keycode, pressed);
+
if (pressed)
{
// Raise KeyDown event
KeyDownEventArgs.Key = key;
KeyDownEventArgs.ScanCode = (uint)e.KeyEvent.keycode;
+ KeyDownEventArgs.Modifiers = keyboard.GetModifiers();
KeyDown(this, KeyDownEventArgs);
}
else
{
// Raise KeyUp event
KeyUpEventArgs.Key = key;
KeyUpEventArgs.ScanCode = (uint)e.KeyEvent.keycode;
+ KeyUpEventArgs.Modifiers = keyboard.GetModifiers();
KeyUp(this, KeyDownEventArgs);
}
- // Update legacy GameWindow.Keyboard API:
- keyboard.SetKey(key, (uint)e.KeyEvent.keycode, pressed);
-
if (pressed)
{
// Translate XKeyPress to characters and

0 comments on commit ee1fb2a

Please sign in to comment.