1
votes

I'm trying to create a custom keyboard .keylayout file for OS X. I need the correct modifier for mapset value. First the user presses the caps lock key. Next the user presses command key + some letter. My current attempts have failed because of wrong modifier value inside the <keyMapSelect> tag and OS X won't load the .keylayout file because of this error.

BTW, 1) Is there a detailed tutorial/guide/spec for .keylayout files? I can't find any.

2) What is the meaning of "?" in the modifier value? (E.g. <modifier keys="command anyShift? caps? anyOption? anyControl?" />)

<keyMapSelect mapIndex="6">
    <modifier keys="command caps?"> <!-- need correct value for keys -->
<keyMapSelect>
1

1 Answers

0
votes

Sounds like what you're looking for is <modifier keys="caps command"/>.

As for your BTWs:

  1. There's this Technical Note from Apple: https://developer.apple.com/library/archive/technotes/tn2056/_index.html.

  2. The question mark means the map indexed will apply regardless of whether the modifier key is depressed or not (as opposed to no question mark which means it only applies when the modifier key is depressed, and to no mention of the modifier key at all which means it only applies when it is not depressed). Some examples:

  • <modifier keys="command"/>: applies when command is depressed and shift (or any other modifier key) is not.
  • <modifier keys="command anyShift"/>: applies when both command and shift are depressed (and no other modifier keys).
  • <modifier keys="command anyShift?"/>: applies when command is depressed regardless of whether shift is depressed or not (as long as no other modifier keys are depressed).