mirror of
https://github.com/sojamo/controlp5
synced 2024-11-22 05:57:57 +01:00
Bugfix keyCode bigger than mapped numKeys inside keyEvent method
This commit is contained in:
parent
1f7cb64986
commit
bbd28010e5
2
.gitignore
vendored
2
.gitignore
vendored
@ -9,3 +9,5 @@
|
|||||||
.buildpath
|
.buildpath
|
||||||
.classpath
|
.classpath
|
||||||
.project
|
.project
|
||||||
|
.idea
|
||||||
|
pom.xml
|
@ -458,6 +458,11 @@ public final class ControlWindow {
|
|||||||
|
|
||||||
public void keyEvent( KeyEvent theKeyEvent ) {
|
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 ) {
|
if ( theKeyEvent.getAction( ) == KeyEvent.PRESS ) {
|
||||||
keys[ theKeyEvent.getKeyCode( ) ] = true;
|
keys[ theKeyEvent.getKeyCode( ) ] = true;
|
||||||
numOfActiveKeys++;
|
numOfActiveKeys++;
|
||||||
|
Loading…
Reference in New Issue
Block a user