Implemented KeyDown and KeyUp events for Sdl2NativeWindow.

This commit is contained in:
Elias Holzer 2013-11-22 18:04:53 +01:00
parent 38532804ec
commit f851d8887c

View file

@ -214,6 +214,15 @@ namespace OpenTK.Platform.SDL2
{
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);
}