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

[Bug] Pattern Editor detects CTRL as stuck #2019

Closed
1 task
PerfectlyFineCode opened this issue Dec 20, 2024 · 13 comments
Closed
1 task

[Bug] Pattern Editor detects CTRL as stuck #2019

PerfectlyFineCode opened this issue Dec 20, 2024 · 13 comments
Labels
bug Something isn't working

Comments

@PerfectlyFineCode
Copy link

Operating System

Windows

What's the issue you encountered?

Sometimes pattern editor thinks CTRL modifier key is pressed so the pattern editor becomes unusable.

How can the issue be reproduced?

  1. Write something in pattern editor
  2. not exactly sure what I did but I just alt tabbed (ALT + TAB) out of the program and it started acting weird

ImHex Version

1.35.4 [811214d]

ImHex Build Type

  • Nightly or built from sources

Installation type

MSI

Additional context?

No response

@PerfectlyFineCode PerfectlyFineCode added the bug Something isn't working label Dec 20, 2024
@WerWolv
Copy link
Owner

WerWolv commented Dec 20, 2024

Hey! I've had this issue before too but so far only on Linux. On Windows it seems to work pretty consistently for me. Does it only affect the pattern editor for you or is it the entirety of ImHex? Like other text fields / shortcuts / etc as well?

@WerWolv
Copy link
Owner

WerWolv commented Dec 20, 2024

Might be something for @paxcut

@paxcut
Copy link
Contributor

paxcut commented Dec 20, 2024

Is this reproducible in your computer? Does it happen every time you Alt-TAB in and out of the editor? I tried it on my local build and nothing bad happened. I 've had similar problems but on clion, not on imhex usually pressing ctrl-alt on both left and right sides clears it. Im not sure what causes it though it is not alt-tab

@PerfectlyFineCode
Copy link
Author

PerfectlyFineCode commented Dec 20, 2024

Is this reproducible in your computer? Does it happen every time you Alt-TAB in and out of the editor? I tried it on my local build and nothing bad happened. I 've had similar problems but on clion, not on imhex usually pressing ctrl-alt on both left and right sides clears it. Im not sure what causes it though it is not alt-tab

That has actually never happened for me and I had used CLion too.

I reproduced it. I just spammed letters and keys into the pattern editor and it happens. Seems to happen in the entire app, but no other app has that issue when it is acting strange. Seems to be happening at random however, I haven't been able to reproduce it to a 100% (two times) second time as a fluke (I was just writing normally in the pattern editor)

I have auto-evaluate enabled.

@PerfectlyFineCode
Copy link
Author

PerfectlyFineCode commented Dec 20, 2024

Recording.2024-12-20.183446.mp4

@paxcut
Copy link
Contributor

paxcut commented Dec 20, 2024

Im not sure what to make of this. I turned auto evaluate on and proceeded to spam keys and delete them as you do and I can't get it stuck like you show. If i pause the spamming for a second the auto evaluate kicks in and I loose focus to the screen so i just click it and continue to spam and delete keys. Does it only happen when auto evaluate is on?

@PerfectlyFineCode
Copy link
Author

Im not sure what to make of this. I turned auto evaluate on and proceeded to spam keys and delete them as you do and I can't get it stuck like you show. If i pause the spamming for a second the auto evaluate kicks in and I loose focus to the screen so i just click it and continue to spam and delete keys. Does it only happen when auto evaluate is on?

I got the bug with auto evaluate being toggled off too. 🤔

@WerWolv
Copy link
Owner

WerWolv commented Dec 20, 2024

Yeah I don't think this has anything to do with auto evaluate. Rather with the Shortcut manager or with how ImGui/glfw handles modifiers.

I can reproduce it pretty effortlessly on Linux. Not on Windows though

@WerWolv
Copy link
Owner

WerWolv commented Dec 27, 2024

Okay I managed to reproduce it everywhere now pretty consistently. If you hold down ALT GR first, then hold down SHIFT and then press enter while still holding the two other keys, CTRL gets stuck pretty consistently.
The reason seems to be a glfw bug of some sorts. ImGui uses glfwGetKey(window, GLFW_KEY_LEFT_CONTROL) == GLFW_PRESS) to check if the ctrl button is being pressed. This function returns the last key event that was sent for this key. When in this weird state, glfwGetKey seems to always return GLFW_PRESS as if glfw didn't receive a key release event.

I'll see if I can rewrite the code somehow to work around this bug, just figured I'd report my findings back for now

@WerWolv
Copy link
Owner

WerWolv commented Dec 27, 2024

@PerfectlyFineCode Do you happen to use a German (or similar) keyboard layout as well?

Edit: Actually I believe any keyboard layout that maps ALT GR to CTRL + ALT causes the issue.

@PerfectlyFineCode
Copy link
Author

@PerfectlyFineCode Do you happen to use a German (or similar) keyboard layout as well?

Edit: Actually I believe any keyboard layout that maps ALT GR to CTRL + ALT causes the issue.

Yes, I use the Nordic keyboard layout.

@WerWolv
Copy link
Owner

WerWolv commented Dec 27, 2024

I believe I managed to fix it. At least I can't reproduce it anymore like I did before.
If you have time, could you try the latest build once GitHub is done building it?

@PerfectlyFineCode
Copy link
Author

PerfectlyFineCode commented Dec 29, 2024

I believe I managed to fix it. At least I can't reproduce it anymore like I did before. If you have time, could you try the latest build once GitHub is done building it?

I haven't been able to reproduce it yet using the fix: 5af2867
Will re-open if anything changes but for now. mark it as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants