Sequential icon indicating copy to clipboard operation
Sequential copied to clipboard

Keyboard shortcuts do not trigger the correct action on an azerty keyboard

Open thibaudcolas opened this issue 11 years ago • 4 comments

Hey there,

there seems to be an issue with the way Sequential handles keyboard shortcuts on azerty: shortcuts seem to be bound to the key's position, not to the character that's entered.

For example:

  • Pressing ⌘ + , does not open Preferences, it minimizes the window instead (like ⌘ + M), because on azerty , is where m is on a qwerty layout.
  • A quits Sequential (A is placed where Q is on a qwerty layout)

This issue does not affect all keyboard shortcuts (for example ⌘ + Maj + A works fine). I tried to look at the code in PGDocumentController.m, #L647 but my knowledge of Obj-C is very limited.

thibaudcolas avatar Dec 22 '14 03:12 thibaudcolas

This project is very old and I'm not maintaining it anymore. I believe the problem was that some keyboard layouts (e.g. Russian?) require the use of physical keycodes, while others require the use of logical characters.

To work around the issue you could #ifdef an alternate mapping in PGKeyboardLayout.h. A proper solution (for all layouts) would be more complicated, but maybe there is a library that would take care of it. I would accept pull requests for either approach.

btrask avatar Dec 22 '14 23:12 btrask

Thank you for your answer, it's nice to see that you're still looking after the project after such a long time.

My knowledge of OSX development is very lacking but I did manage to build it from source and get it running, so I might as well give it a try. I'll hopefully submit a PR.

Further notes:

  • I'm on OSX Mavericks (10.9), I don't know if I can produce builds which will be compatible with previous versions. TODO: look it up.
  • When I got that first build running, I had to modify a lot of lines which caused build errors. This may be due to the above "version of OSX frameworks" problem (there were a few deprecation notices in here too). TODO: find history of API changes for all those lines.
  • In this build, I did not encounter the "A quits Sequential" bug I reported above. I cannot tell if this is due to:
    • some kind of lack of support for OSX Mavericks in the build available online
    • the fact that I compiled this build on a computer with an azerty keyboard
    • the lines that I changed to get the build running
  • For the "⌘ + , minimizes the window" issue, I only encountered it when Sequential's main window was open. If there is no window, it correctly opens the Preferences pane.

Wish me luck!

thibaudcolas avatar Dec 24 '14 00:12 thibaudcolas

I haven't checked it but this commit might help with 10.9.

btrask avatar Dec 25 '14 00:12 btrask

Since encountering this bug, I have... switched to a QWERTY computer. Which means that I've lost interest in making a fix.

If someone wants to investigate this further, here are links that were useful at the time:

  • http://blog.shpakovski.com/2012/07/global-keyboard-shortcuts-in-cocoa.html
  • https://github.com/shpakovski/MASShortcut
  • https://github.com/shpakovski/MASShortcutDemo
  • https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/EventOverview/HandlingKeyEvents/HandlingKeyEvents.html

thibaudcolas avatar Aug 06 '16 17:08 thibaudcolas