Skip to content

keyPressed is true with no keys pressed after specific sequence of SHIFT and any letter key #779

Closed

Description

@processing-bot

Created by: keppy442b

Description

keyPressed is true with no keys actively pressed after doing a specific sequence of key presses with SHIFT and a letter key. It also occurs with CTRL and a letter key. This is more easily reproduced with P2D, but it does occur with the default renderer as well.

Expected Behavior

keyPressed should be false when no keys are actively pressed.

Current Behavior

Steps to Reproduce

  1. Press and hold a letter key
  2. While still holding letter key, press and hold SHIFT
  3. While still holding SHIFT, release the letter key
  4. Release SHIFT

Pressing CTRL instead of SHIFT will also produce the behavior. It appears the only way to set keyPressed back to false is to press/release the specific letter key again. So if you did SHIFT+a, press and release a to set keyPressed back to the expected behavior. You can try to reproduce the behavior with this sketch:

color black = color(36,39,45);
color green = color(141,187,110);
void setup(){
  size(1600,900,P2D); 
}

void draw(){
  if (keyPressed){
    background(green);
  } else{
    background(black);
  }
}

Your Environment

  • Processing version: 4.3
  • Operating System and OS version: Windows 10 Home 22H2 19045.3324

Activity

  1. processing-bot commented on Jan 23, 2024

    @processing-bot
    CollaboratorAuthor

    Created by: T-vaccari

    Hello, I would like to contribute to this issue, is it still open?

  2. Rishab87 commented on Mar 22, 2025

    @Rishab87
    Contributor

    Hi @SableRaf, #966 also fixes this issue

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

Metadata

Metadata

Assignees

Labels

help wantedopengl

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions