mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-24 17:45:37 +00:00
[X11] Implemented modifier keys
This commit is contained in:
parent
9ba21d6017
commit
ee1fb2a917
|
@ -849,11 +849,15 @@ namespace OpenTK.Platform.X11
|
|||
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
|
||||
|
@ -861,12 +865,10 @@ namespace OpenTK.Platform.X11
|
|||
// 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
|
||||
|
|
Loading…
Reference in a new issue