mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-25 06:25:28 +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;
|
Key key;
|
||||||
if (driver.TranslateKey(ref e.KeyEvent, out key))
|
if (driver.TranslateKey(ref e.KeyEvent, out key))
|
||||||
{
|
{
|
||||||
|
// Update legacy GameWindow.Keyboard API:
|
||||||
|
keyboard.SetKey(key, (uint)e.KeyEvent.keycode, pressed);
|
||||||
|
|
||||||
if (pressed)
|
if (pressed)
|
||||||
{
|
{
|
||||||
// Raise KeyDown event
|
// Raise KeyDown event
|
||||||
KeyDownEventArgs.Key = key;
|
KeyDownEventArgs.Key = key;
|
||||||
KeyDownEventArgs.ScanCode = (uint)e.KeyEvent.keycode;
|
KeyDownEventArgs.ScanCode = (uint)e.KeyEvent.keycode;
|
||||||
|
KeyDownEventArgs.Modifiers = keyboard.GetModifiers();
|
||||||
KeyDown(this, KeyDownEventArgs);
|
KeyDown(this, KeyDownEventArgs);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -861,12 +865,10 @@ namespace OpenTK.Platform.X11
|
||||||
// Raise KeyUp event
|
// Raise KeyUp event
|
||||||
KeyUpEventArgs.Key = key;
|
KeyUpEventArgs.Key = key;
|
||||||
KeyUpEventArgs.ScanCode = (uint)e.KeyEvent.keycode;
|
KeyUpEventArgs.ScanCode = (uint)e.KeyEvent.keycode;
|
||||||
|
KeyUpEventArgs.Modifiers = keyboard.GetModifiers();
|
||||||
KeyUp(this, KeyDownEventArgs);
|
KeyUp(this, KeyDownEventArgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update legacy GameWindow.Keyboard API:
|
|
||||||
keyboard.SetKey(key, (uint)e.KeyEvent.keycode, pressed);
|
|
||||||
|
|
||||||
if (pressed)
|
if (pressed)
|
||||||
{
|
{
|
||||||
// Translate XKeyPress to characters and
|
// Translate XKeyPress to characters and
|
||||||
|
|
Loading…
Reference in a new issue