mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-11 08:35:39 +00:00
[Input] Do not crash with scancodes > 255
This commit is contained in:
parent
6c6e09aae6
commit
ab8796c942
|
@ -201,6 +201,10 @@ namespace OpenTK.Input
|
|||
{
|
||||
if (keys[(int)key] != state || KeyRepeat)
|
||||
{
|
||||
// limit scancode to 8bits, otherwise the assignment
|
||||
// below will crash randomly
|
||||
scancode &= 0xff;
|
||||
|
||||
keys[(int)key] = scancodes[scancode] = state;
|
||||
|
||||
if (state && KeyDown != null)
|
||||
|
|
Loading…
Reference in a new issue