Permalink
Browse files

Implemented KeyDown and KeyUp events for Sdl2NativeWindow.

  • Loading branch information...
1 parent 3853280 commit f851d8887c477f1f983a97d78930f3c75cef15ab @azeno azeno committed Nov 22, 2013
Showing with 9 additions and 0 deletions.
  1. +9 −0 Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs
@@ -214,6 +214,15 @@ static void ProcessKeyEvent(Sdl2NativeWindow window, Event ev)
{
bool key_pressed = ev.Key.State == State.Pressed;
var key = ev.Key.Keysym;
+ var args = new KeyboardKeyEventArgs()
+ {
+ Key = TranslateKey(key.Scancode),
+ ScanCode = (uint)key.Scancode
+ };
+ if (key_pressed)
+ window.KeyDown(window, args);
+ else
+ window.KeyUp(window, args);
//window.keyboard.SetKey(TranslateKey(key.scancode), (uint)key.scancode, key_pressed);
}

0 comments on commit f851d88

Please sign in to comment.