lwouis / alt-tab-macos

Windows alt-tab on macOS
https://alt-tab-macos.netlify.app
GNU General Public License v3.0
11.02k stars 330 forks source link

Finnish keyboard issue where "Shortcut 2" is reset/unset on every update #2125

Open lasselaakkonen opened 2 years ago

lasselaakkonen commented 2 years ago

Describe the bug

~On every update of the app, for the last many updates, the "Shortcut 2" has been reset/unset.~

EDIT: Restarting AltTab (which happens when updating AltTab) can in some scenarios reset shortcuts.

~Steps to reproduce the bug~

  1. ~Have some old app version installed~
  2. ~Configure Shortcut 2 to CMD+`~

image

  1. ~Update to latest version (eg 6.50.0)~
  2. ~Shortcut 2 is no longer set to CMD+`~

image

Your environment

EDIT: Steps to reproduce

Using macOS 13.0 (22A380), AltTab 6.54.0.

On US layout there is the key ;, on SU layout the same key is for ö.

Reproducing requires that you restart AltTab when the keyboard layout is different from what it was when setting a shortcut, while using key that is different in both layouts (eg CMD+Space is not reset).

lwouis commented 2 years ago

v6.49.0 introduced a fix for international keyboard (https://github.com/lwouis/alt-tab-macos/issues/1190). It may have impacted you if you had the Finnish layout.

What shortcut did you have set before the updates? Backtick on US-keyboard, or something else? Also, which versions did you update from/to, specifically?

lasselaakkonen commented 2 years ago

The shortcut was set to CMD+backtick on US keyboard.

I don't know what version I update from, I'm guessing the previous version, because I have always updated when AltTab has informed of an update. I updated to 6.50.0.

The issue has happened enough in the past updates, that after this latest update I instinctively went to the settings to reconfigure the shortcut. I don't know what was the first update where it happened.

lwouis commented 2 years ago

@lasselaakkonen how many times would you say it happened?

lasselaakkonen commented 2 years ago

@lwouis really hard to estimate, more than 2x, because I knew to go check the settings after the update, but maybe max 5x.

Pajn commented 1 year ago

This happens 2-3 time a week for me. It's hard to say why, I haven't found a concrete action that resets it but it's very annoying and basically makes the shortcut two unusuable.

I'm using the key next to one as shortcut and regularily switches keyboard layout between english and swedish so the character varies between ` and < but before the setting gets reset it works in both layouts. The settings dialog always seems to record it as ` though. Switching layouts is not what's triggering the bug, before it gets reset I can switch back and forward multiple times without issue.

lasselaakkonen-congrid commented 1 year ago

Unlike for @Pajn, for me the issue has not come up randomly, only in updates in the past.

lasselaakkonen-congrid commented 1 year ago

There seemed to be an update available now, so I updated AltTab, but did not run in to the issue this time...

lasselaakkonen-congrid commented 1 year ago

So, perhaps the keyboard layout thing is somehow involved in this.

Last time I updated from v6.50 to v6.52.1 I had the US keyboard layout enabled and the issue did not arise.

Today:

lwouis commented 1 year ago

@lasselaakkonen thank you for sharing this new data; it's interesting.

I can't imagine how upgrading would impact this. I suspect that simply quitting and re-opening the app could potentially trigger the same behavior. Could you perhaps try to reproduce the steps but with a simple restart instead of an upgrade?

In your steps, I'm not sure if you were on keyboard layout SU or US when you set the shortcut in AltTab by the way. So the steps would be, I think:

lasselaakkonen commented 1 year ago

As you guessed, it was not dependent on the upgrade, that just happened to be one of the rare times that I restart AltTab.

About the keyboard layouts, on US layout there is the key ;, on SU layout the same key is for ö.

This is how to reproduce:

Using macOS 13.0 (22A380), AltTab 6.54.0.

Reproducing requires that you restart AltTab when the keyboard layout is different from what it was when setting a shortcut, while using key that is different in both layouts (eg CMD+Space is not reset).

lwouis commented 1 year ago

I was able to reproduce the issue with the steps above. Thank you!

lwouis commented 1 year ago

The issue seems to be in the ShortcutRecorder library that we use. the SRShortcut instance fails to instanciate with Shortcut(keyEquivalent: ";"), when the keyboard layout is in Finnish.

GJRobert commented 1 year ago

Hi, my problem is setting ⌘ backtick as Shortcut 3 always being reset/unset on every system startup. Seems to be relevant to this issue?

I use Rime as my main input method, and I have indeed another keyboard layout other than US which has a higher priority right after startup.