Open pbodnar opened 4 years ago
Thanks for detailed description.
Can you also reproduce it by just restarting the app (Ctrl+Q and start again)? Maybe the shortcuts are not loaded properly at application start.
If it's a keyboard layout problem: Can you try assigning the shortcut when each layout is active? There is some platform-specific key code translation that could cause the issue.
Can you also reproduce it by just restarting the app (Ctrl+Q and start again)? Maybe the shortcuts are not loaded properly at application start.
That's it! :) Firstly, I wanted to write "sorry, I forgot to mention that starting the app manually is the 2nd workaround". But now that I have tested it again, the problem is unveiled:
Conclusion: At application start the shortcuts loading is dependent on the current keyboard layout.
So a quick & dirty fix would be probably to run the same code as you run when saving the preferences dialog, just after you load the shortcuts at application start.
Hmm, so if you go to shortcut tab in preferences and press OK to apply (event thought there are no changes) the shortcuts work again?
Is there any warning or error in log (F12 shortcut from main window)?
Yes, exactly. It's 100% reproducible on my pc, but I can test it on my second pc on Monday for sure.
In the log there is nothing special, only some "Connection lost" error messages from yesterday, no log items from today's testing, for example...
Update: Sorry for a confusion, but this is a really tricky bug: One needs to have English keyboard activated before clicking OK in the preferences. So when for example Czech is activated, the layout-dependent shortcut stops working. No need for restarts to reproduce.
Hmm, I think I would need to change this code, but I have no idea how.
Can you set multiple shortcuts for each layout? I know there could be potential conflicts but this is the only workaround I can think of -- unless you set the shortcut in desktop environment.
Hmm, I think I would need to change this code, but I have no idea how.
I'm not a Windows API expert myself, so I cannot help with this right now. I only slightly remember there was a possibility to listen for "virtual key" code (given by the key position on keyboard) instead for a translated character code...
Can you set multiple shortcuts for each layout? I know there could be potential conflicts but this is the only workaround I can think of -- unless you set the shortcut in desktop environment.
Yes, it looks like CopyQ lets you add a command multiple times and assign differing keystrokes to the command instances, but that's not that practical as having just one keystroke to remember.
Anyway, the current workaround doesn't luckily require too much hassle: 1) always start Windows / CopyQ with English, 2) don't forget to have English activated when assigning new shortcuts or when saving the CopyQ preferences. And "English" can be possibly exchanged for any other keyboard layout preferred by a user.
Yes, it looks like CopyQ lets you add a command multiple times and assign differing keystrokes to the command instances
You can assign multiple shortcuts to one command (in Command dialog or Shortcuts configuration tab in Preferences). Just click on the +
button next to the shortcut.
Not sure if it would work but you can try assigning the shortcut, then switch keyboard layout and assign the shortcut again (presumably GUI will show different shortcut).
Oh, that's cool, I haven't noticed this feature :) Still, CopyQ won't let me assign the same keystroke multiple times: the same keystroke is not accepted by the GUI even though I switch the layout as suggested. Tried from both, the Command dialog and Shortcuts configuration tab.
Describe the bug If I set a global keyboard shortcut like
Ctrl+`
for a command, it doesn't get mapped (i. e. it doesn't do anything) after Windows restarts. The same happens after user logout and login. But when I use a shortcut likeCtrl+Alt+B
, there is no problem.Workaround (how to avoid the problem) 1) Always start Windows / CopyQ with English, 2) don't forget to have English activated when assigning new shortcuts or when saving the CopyQ preferences. And "English" can be possibly exchanged for any other keyboard layout preferred by a user.
To Reproduce Steps to reproduce the behavior:
Ctrl+`
to theShow/hide main window
command.Expected behavior Any shortcut assigned to a command should work at any moment, including the moment after Windows restart.
Screenshots n/a
Version, OS and Environment
Additional context I guess that this might have something to do with a keyboard layouts "collision" - like that maybe mapping a pressed character works differently when CopyQ gets started automatically on Windows start. (There is also a weird Windows behavior that
Alt+Shift
won't switch keyboards untilWin+Space
is pressed or until an application is launched & focused.)Note that there is also a historical bug #427 that coped with keyboard shortcuts and which might be related to this one.