4

I have created a custom keyboard layout (.keylayout file) and remapped (amongst other keys) the X, C and V keys. However, I want to keep Cmd+X/C/V like on the QWERTY, because it's practical and I am used to it.

So in my layout, I have kept the original X, C, V mappings for when Command is pressed:

<keyMap index="0">  <!-- No modifiers -->
  ...
  <key code="7" action="y" /> <!-- my modified layout -->
  <key code="8" action="x" />
  <key code="9" action="." />
...
<keyMap index="10">  <!-- command -->
  ...
  <key code="7" output="x" /> <!-- same as qwerty -->
  <key code="8" output="c" />
  <key code="9" output="v" />

This works well except for Command+. (which should do a Command+V, i.e. paste) in Safari, Mail and a few other Apple applications… In that case, using the original V key (on a QWERTY keyboard) does work…

I don't understand why it fails just for this shortcut? I've read that some Cmd+… shortcuts are special and can't be overridden, but why does it work with cut/copy but not with paste? And why does it work in all applications except Safari and Mail?


I've used the bepo (french dvorak) layout and edited it in a text editor. My version is on GitHub. I have opened my layout in Ukulele and it shows it quite fine, is there anything I could try with it to debug/detect problems?

I have also tried to open+save my layout with Ukulele and it doesn't work anymore, it's not even detected by OS X. I have reverted back to my version.

  • Did you use Ukelele to make your custom layout? – Tom Gewecke Apr 13 '15 at 5:11
  • No I used the bepo (french dvorak) layout and edited it in a text editor. My version is on github. I have opened my layout in Ukulele and it shows it quite fine, is there anything I could try with it to debug/detect problems? – Matthieu Napoli Apr 13 '15 at 11:59
  • You might try saving it in Ukelele to see if it makes any difference. Also there is a Ukelele mailing list where someone might have an idea: groups.google.com/forum/#!forum/ukelele-users – Tom Gewecke Apr 13 '15 at 12:40
  • @TomGewecke I have tried to open+save my layout with Ukulele and it doesn't work anymore, it's not even detected by OS X. I have reverted back to my version. I'll ask on the mailing list thanks for the link. – Matthieu Napoli Apr 13 '15 at 21:13
  • The ukelele users group was unable to help? – Tom Gewecke Sep 15 '16 at 20:41
3
+200

I'm not surprised you may be experiencing this issue with Apple Software. Basically the Command-. keyboard shortcut has been used by Mac OS for decades as a universal "halt operations" keyboard shortcut.

In a sense it works in a similar way to the ESC key. So I am thinking this is why you are experiencing problems with this keyboard shortcut. It used to be that software developers had to respect this Command-. keyboard shortcut for any software they developed for the Mac platform, but this is no longer the case, hence why your keyboard shortcut may be working with some software but not others. You may want to read the Keyboard Shortcuts page in the macOS Human Interface Guidelines.

Extra Info

Apple first introduced the Command key in 1980 with the Apple III computer.

The purpose of the Command key was to allow users to enter keyboard commands in applications and within the operating system. The Macintosh Human Interface Guidelines have always recommended that developers use the Command key (and not the Control or Option keys) for this purpose.

A small set of keyboard commands (such as cut and paste, open and save) are standard across all applications. If an application needs more shortcuts than can be obtained with the twenty-six letters of the English alphabet, double modifiers such as Command+Option are used.

The Macintosh keyboard's other unusual modifier key, the Option key, serves as a modifier both for entering keyboard shortcuts and for typing text — it is used to enter foreign characters, typographical symbols, and other special characters.

As mentioned previously, the Command-. shortcut was once a universal recommended shortcut, but this is no longer reserved by macOS. In fact, Table 67-3 of the macOS Human Interface Guidelines now only lists one keyboard shortcut with a period (.) in it. This is the Control-Option-Command-. keyboard shortcut for increasing screen contrast. You can read more about this in Accessibility Programming Guide for OS X.

  • Oh wow thank you for getting to the bottom of this, it's been bugging me for maybe five years! Now with "what can I do" questions :) (1) Is there a chance that macOS Sierra or future macOS will fix it since this shortcut is no longer reserved? (2) Do you see anything that I can do? – Matthieu Napoli Sep 20 '16 at 9:55
  • These are only my first thoughts: (1) Yes, there is a chance that future Apple software / operating systems will no longer use the Command + . shortcut, especially as new software is developed - but the incentive to remove it from existing software may not be there as many long-term users (myself included) still default to using the Command + . shortcut to stop a process they've just started. – Monomeeth Sep 20 '16 at 11:12
  • (2) The main thing you could do is change the shortcut, but I appreciate you won't want to do that. But you may already be used to using the CTRL key on Windows machines for cut/copy/paste etc, so maybe... :) You may also get some temporary relief from using a different browser, etc. (although I'm pretty sure that both Firefox and Chrome use the Command + . shortcut on Macs to stop a process. Another option may be to play with the various settings in the Keyboard pane of System preferences (but you've probably already tried this at some point and had no joy). – Monomeeth Sep 20 '16 at 11:12
  • (2) I actually remapped Command and Control a long time ago (System Preferences) and always used it that way. TBH I never tried without the remapping to see if it would work. To be clear I'm pressing Ctrl+v and it translates to Command+. Also I'm using Chrome for this reason, and Airmail too. The apps where there's the problem are: Safari, Mail. The Apple apps where it works: Calendar, Notes, TextEdit, Pages, App Store, etc. That's why I find it so weird… Only Mail and Safari… – Matthieu Napoli Sep 20 '16 at 15:00
  • Oh and actually (I don't try that often since I tend to avoid those apps) pasting works everywhere in Mail except in a mail body (when writing a new email). In Safari it doesn't work in the address bar and in website forms (but works for example in preferences). I think it's something to do with application widgets or something… – Matthieu Napoli Sep 20 '16 at 15:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .