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

Fix incorrect keyboard shortcut actions in popups #459

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

Conversation

Gee-64
Copy link
Contributor

@Gee-64 Gee-64 commented Jan 12, 2025

NOTE: This PR covers the half of what still remains after #440 was closed.

When using keyboard shortcuts in popups an incorrect value is often returned from poll(), causing the wrong action to be taken.

The problem is that an "active button index" is returned rather than the expected "absolute button index".

Refactored code to return the correct value in all situations.

Bug reproduction:

  1. Navigate to a random file you want to delete

  2. Hit Enter

  3. Select "Delete"

  4. When you get the "Are you sure?" question pop, press the "Y" key on the keyboard - and you will see the file NOT being deleted

  5. Try again, but press the "N" key, and the file WILL (incorrectly) be deleted

When using keyboard shortcuts in popups an incorrect value is often returned
from poll(), causing the wrong action to be taken.

The problem is that an "active button index" is returned rather than the
expected "absolute button index".

Refactored code to return the correct value in all situations.

Bug reproduction:

1. Navigate to a random file you want to delete

2. Hit Enter

3. Select "Delete"

4. When you get the "Are you sure?" question pop, press the "Y" key on the keyboard - and you will see the file NOT being deleted

5. Try again, but press the "N" key, and the file WILL (incorrectly) be deleted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant