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

problem when pressing and holding key #5049

Closed
skp10 opened this Issue May 4, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@skp10

skp10 commented May 4, 2017

I am using the latest version of processing which is 3.3.3.

just add this code to processing and when you run the code, hold any key for (5 sec) and release it.
IT WOULD NOT TURN BACK TO (FALSE)

void draw() {
  if (keyPressed) {
    println(true);
  } else {
    println(false);
  }
}

JakubValtar added a commit to JakubValtar/processing that referenced this issue May 4, 2017

Fix keyPressed for multiple keys
Java2D and FX2D send multiple PRESSED and only one RELEASE event (at
least on Windows). Therefore we have to keep track of what is pressed
and what not. Most keyboards do not support pressing more than ~10 keys
simultaneously, so this should not cause any performance problems.

Fixes #5049

@benfry benfry closed this in #5050 May 5, 2017

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry May 5, 2017

Member

Sorry for the confusion; I'd forgotten that when a key repeats, it never sends a "key released" event, which means that if you hold a key long enough, it would cause things to stay stuck. At any rate, we now have a fix for the next release.

Member

benfry commented May 5, 2017

Sorry for the confusion; I'd forgotten that when a key repeats, it never sends a "key released" event, which means that if you hold a key long enough, it would cause things to stay stuck. At any rate, we now have a fix for the next release.

@hkiel

This comment has been minimized.

Show comment
Hide comment
@hkiel

hkiel Feb 19, 2018

Using 3.3.6 I see the same problem (on macOS) again.
The example code will either stay showing true, or if it shows false it will not accept any keypress for quite some time. keyReleased() is still called, but not keyPressed()

System usually recovers after some time. I one case, however, even the IDE did not respond to any key press. Operating the menus via mouse worked (mark some code and cut the selection, or quit processing)

hkiel commented Feb 19, 2018

Using 3.3.6 I see the same problem (on macOS) again.
The example code will either stay showing true, or if it shows false it will not accept any keypress for quite some time. keyReleased() is still called, but not keyPressed()

System usually recovers after some time. I one case, however, even the IDE did not respond to any key press. Operating the menus via mouse worked (mark some code and cut the selection, or quit processing)

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Feb 20, 2018

Member

You're probably running into this problem that Apple introduced in Sierra: https://github.com/processing/processing/wiki/Troubleshooting#key-repeat-on-macos-sierra

Locking because this original issue posted here was resolved 9 months ago. For anyone having a new issue, please file a new report.

Member

benfry commented Feb 20, 2018

You're probably running into this problem that Apple introduced in Sierra: https://github.com/processing/processing/wiki/Troubleshooting#key-repeat-on-macos-sierra

Locking because this original issue posted here was resolved 9 months ago. For anyone having a new issue, please file a new report.

@processing processing locked and limited conversation to collaborators Feb 20, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.