mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-11 11:55:38 +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)
|
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;
|
keys[(int)key] = scancodes[scancode] = state;
|
||||||
|
|
||||||
if (state && KeyDown != null)
|
if (state && KeyDown != null)
|
||||||
|
|
Loading…
Reference in a new issue