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] Keyboard shortcuts in editor for macOS no long work in 1.34.0 #1757

Open
1 task
neutron-ice opened this issue Jun 11, 2024 · 12 comments
Open
1 task
Labels
bug Something isn't working

Comments

@neutron-ice
Copy link

Operating System

MacOS

What's the issue you encountered?

In the Pattern Editor keyboard shortcuts, like CMD+C or CMD+V and some rest no longer work.

Downgraded to the previous version 1.33.2 – everything is okey.

How can the issue be reproduced?

When in settings assign new shortcut, e.g. press "CMD+V" instead I see "CTRL+V". When press CTRL+V instead I see "CMD+V".

But anyway nothing work in editor, irrelevant it is "cmd+v" or "ctrl+v" – work only nowhere else defined Alt+V.
Undo (CMD+Z) work like nowhere else defined "CMD+Backspace/Del".

keysbug.mp4

ImHex Version

1.34.0

ImHex Build Type

  • Nightly or built from sources

Installation type

Portable

Additional context?

Apple M1, macOS 12.6

@neutron-ice neutron-ice added the bug Something isn't working label Jun 11, 2024
@neutron-ice neutron-ice changed the title [Bug] Keyboard shortcuts in editor for macOS no long work [Bug] Keyboard shortcuts in editor for macOS no long work in 1.34.0 Jun 11, 2024
@paxcut
Copy link
Contributor

paxcut commented Jun 11, 2024

There seems to be two separate errors reported. One is about the pattern editor where the mac shortcuts no longer work. The pattern editor is undergoing a transition where the shortcuts will be part of the shortcuts manager and will be editable like all the other shortcuts, but only the part that removed the old shortcut code made it to the release. Once the pr that adds the new shortcuts is merged then it should work again.
The other issue is about editing shortcuts in the hex editor and I know nothing about that.

@sisco0
Copy link

sisco0 commented Jun 11, 2024

Regarding the cmd vs ctrl inconvenience,
@neutron-ice
Could you kindly check if keys are properly interpreted at other applications/websites? e.g. https://en.key-test.ru

@neutron-ice
Copy link
Author

Could you kindly check if keys are properly interpreted at other applications/websites?

Yep, everything is properly interpreted. At same time in same environment previous version (1.33.2) works correctly, something happened with new version:

nobugs.mp4

@root670
Copy link

root670 commented Jun 16, 2024

It seems Cmd and Ctrl have been swapped. For example undo should be Cmd-Z but only works with Ctrl-Z now. When pressing cmd or ctrl in the shortcut screen they appear swapped (i.e. press Cmd and it shows up as Ctrl)

@paxcut
Copy link
Contributor

paxcut commented Jun 17, 2024

There has been a recent commit that seems to be aimed at this issue but it is missing two important details

  1. The pattern editor shortcut code has been moved to be part of the shortcut manager so the changes made in the commit will not be relevant if pr feat: full syntax highlights and interactive compiler error reporting indicated using a red squiggly line under the affected symbols. #1700 is merged.
  2. The main issue becomes that the shortcuts for Mac are done incorrectly for the entire Imhex and not only for the pattern editor. Searching for changes that affect mac shortcuts point to pr Support macOS keyboard shortcuts #889 but that code has been in place since Jan 2023 so there must be more recent changes that are causing the the issue as it is reported that 1.33.2 works fine.

@gkpln3
Copy link

gkpln3 commented Jun 30, 2024

It appears that each time i press CMD it interprets it as CTRL instead, and CTRL is interpreted as CMD.

@paxcut
Copy link
Contributor

paxcut commented Jun 30, 2024

Does that swapping of keys happen everywhere on Imhex? The pattern editor and the hax editor have independent mappings for keys.In fact if you check the shortcut tab in settings you'll see all the different places where mappings could be different which of course includes the shortcut tab window itself.

@KevinCCucumber
Copy link

KevinCCucumber commented Aug 14, 2024

M2 Max Macbook user here. For me, sometimes control is accepted instead of cmd, but not really reproducible.
Using CMD does neither work in the pattern editor nor in the imhex window. Checking in the shortcut settings, control and cmd are indeed swapped for me.
Version 1.34.0

@zakkhoyt
Copy link

Same issue here (cmd and ctrl keys are reversed)/.

M2 max here. I took a video for you to demo.

ImHex_20240928185129.mp4

@paxcut
Copy link
Contributor

paxcut commented Sep 29, 2024

This is probably an issue with how imgui handles mac keys because afaik imhex uses imgui to obtain keys in any os. The strange think is that it used to work and now it doesn't, yet there has been no changes to the key handling code in quite some time. I did find older issues in imgui that mention how ctrl and cmd were swapped twice and then one of the swaps was removed. but that should have been fixed by now.

Having re-definable shortcuts means you can still define the shortcuts to be exactly what you prefer. Until we can figure out why keys are swapped now (and for that we need mac users to debug imhex) Define the shortcuts how you prefer (recently the shortcuts for the pattern editor were added to the list of re-definable shortcuts) and wait for a mac user that can debug imhex to figure it out.

@MaKiPL
Copy link

MaKiPL commented Oct 26, 2024

Bump, still happens on 1.35.4
Macbook Air M1, MacOS 15.0.1

@Next-Door-Tech
Copy link

Somehow missed this when searching for existing issues - accidentally created duplicate #1954.

TL;DR: the issue where cmd/ctrl are swapped affects ALL shortcuts (not just the pattern editor), and also affects Intel Macs (I'm on a MBP 16" 2019 w/ a Core i9).

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

9 participants