diff --git a/.gitignore b/.gitignore index 37752ba..fbecc77 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ .buildpath .classpath .project +.idea +pom.xml \ No newline at end of file diff --git a/src/controlP5/ControlWindow.java b/src/controlP5/ControlWindow.java index 968d172..b64b838 100755 --- a/src/controlP5/ControlWindow.java +++ b/src/controlP5/ControlWindow.java @@ -458,6 +458,11 @@ public final class ControlWindow { public void keyEvent( KeyEvent theKeyEvent ) { + if (theKeyEvent.getKeyCode() > numKeys) { + // Something is wrong, a key was typed which is not mapped! + return; + } + if ( theKeyEvent.getAction( ) == KeyEvent.PRESS ) { keys[ theKeyEvent.getKeyCode( ) ] = true; numOfActiveKeys++;