From 23ad81d12b5bc5345aa11c044453c0d27821662d Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Thu, 21 Oct 2010 07:56:48 +0000 Subject: [PATCH] * Platform/X11/X11Keyboard.cs: Added index bounds check for GetState. --- Source/OpenTK/Platform/X11/X11Keyboard.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/OpenTK/Platform/X11/X11Keyboard.cs b/Source/OpenTK/Platform/X11/X11Keyboard.cs index 8bf6919c..d346e4fd 100644 --- a/Source/OpenTK/Platform/X11/X11Keyboard.cs +++ b/Source/OpenTK/Platform/X11/X11Keyboard.cs @@ -75,6 +75,10 @@ namespace OpenTK.Platform.X11 public KeyboardState GetState(int index) { + // X11Keyboard supports a single keyboard only + if (index < 0 || index > 1) + throw new ArgumentOutOfRangeException("index"); + ProcessEvents(); return state; }