Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix keyCode bigger than mapped numKeys inside keyEvent method #128

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Bugfix keyCode bigger than mapped numKeys inside keyEvent method #128

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Jul 12, 2018

Hello,

for some strange unknown reasons the method keyEvent inside of ControlWindow recieves a keyCode which cannot be handled by the keys boolean array of a size of only 1024. Then this error message is thrown and the application freeze.

java.lang.ArrayIndexOutOfBoundsException: 61443
at controlP5.ControlWindow.keyEvent(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at processing.core.PApplet$RegisteredMethods.handle(PApplet.java:1408)
at processing.core.PApplet.handleMethods(PApplet.java:1610)
at processing.core.PApplet.handleKeyEvent(PApplet.java:2946)
at processing.core.PApplet.dequeueEvents(PApplet.java:2599)
at processing.core.PApplet.handleDraw(PApplet.java:2437)
at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1557)
at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:316)

My approach was to check for the keyCode if it is bigger than numKeys (bigger than 1024) and exit the method if true. Maybe this is just a workaround and you have a better idea?! Anyway it fixed the bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant