[Input] Do not crash with scancodes > 255
This commit is contained in:
parent
6c6e09aae6
commit
ab8796c942
1 changed files with 4 additions and 0 deletions
|
@ -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