Skip to content

Input command toggles repeatedly when key is held down #2082

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

Open
Denys619 opened this issue Mar 22, 2025 · 2 comments
Open

Input command toggles repeatedly when key is held down #2082

Denys619 opened this issue Mar 22, 2025 · 2 comments

Comments

@Denys619
Copy link
Contributor

Description
When pressing and holding down keys bound to toggle commands (such as toggling the axis visibility ui.axis or other boolean settings), the command rapidly switches its state (on/off/on/off). This causes performance issues, UI flickering, and makes the interaction unpleasant.

To Reproduce
Steps to reproduce the behavior:

  1. Launch F3D.
  2. Press and hold a key bound to a toggle command (e.g., axis visibility).

Expected behavior
When a toggle key is pressed and held, the state of the command should change only once. Holding the key should not trigger repetitive state changes.

System Information:

  • OS: Ubuntu Linux (24.04.2)
  • F3D: Latest master branch (commit hash 9e9123ec760ad0f465e76a5cf1b9b46baf3bd7eb)

F3D Information

Version: 3.0.0-146-g9e9123ec.
Build date: 2025-03-21 18:50:31.
Build system: Linux 64-bits.
Compiler: GNU 13.3.0.
Module ImGui: ON.
Module OpenEXR: OFF.
Module Raytracing: OFF.
VTK version: 9.4.1.

Additional context
The key input handling in vtkF3DImguiObserver triggers repeated KeyPress events without checking if the key is already pressed, causing the command to be continuously executed.

I've attempted a preliminary solution by using a keyState map to prevent repeated toggling, but it didn't fully resolve the issue. A more robust approach may be needed at the input handling or event propagation level.

Demonstration
I've attached a short video demonstrating this issue clearly.

Screencast.from.2025-03-22.08-55-43.webm
@mwestphal
Copy link
Member

Hum, I do not observe any slowdowns when trying to reproduce the issue. Also I'm not sure this behavior is enterely not wanted as some options rely on keep the key pressed down, specifically "L: Increase light intensity".

Maybe we should have a flag by bind to control this behavior ?

What do you think @Meakk ?

@mwestphal mwestphal added this to F3D Mar 24, 2025
@mwestphal mwestphal moved this to Discuss in F3D Mar 24, 2025
@f3d-app f3d-app deleted a comment Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Discuss
Development

No branches or pull requests

2 participants