Implemented KeyDown and KeyUp events for Sdl2NativeWindow.
This commit is contained in:
parent
38532804ec
commit
f851d8887c
1 changed files with 9 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue