[Input] Do not crash with scancodes > 255

This commit is contained in:
thefiddler 2013-12-27 11:10:41 +01:00
parent 6c6e09aae6
commit ab8796c942

View file

@ -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)