Merge branch 'radionics-master' into dev-2.2.7

fix keyCode mapping
This commit is contained in:
andreas schlegel 2018-09-22 09:53:30 +08:00
commit e3bea47dfe
2 changed files with 7 additions and 0 deletions

2
.gitignore vendored
View File

@ -9,3 +9,5 @@
.buildpath .buildpath
.classpath .classpath
.project .project
.idea
pom.xml

View File

@ -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++;