mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-02-02 17:11:10 +00:00
[Input] Use Key.LastKey instead of Enum.GetValues
This avoids unnecessary memory allocations in the KeyboardDevice constructor.
This commit is contained in:
parent
58e41a2b97
commit
3658fac263
|
@ -21,7 +21,7 @@ namespace OpenTK.Input
|
|||
public sealed class KeyboardDevice : IInputDevice
|
||||
{
|
||||
//private IKeyboard keyboard;
|
||||
private bool[] keys = new bool[Enum.GetValues(typeof(Key)).Length];
|
||||
private bool[] keys = new bool[(int)Key.LastKey];
|
||||
private bool[] scancodes = new bool[256];
|
||||
private string description;
|
||||
private int numKeys, numFKeys, numLeds;
|
||||
|
|
Loading…
Reference in a new issue