UTF Custom Keyboard

U.S.-TF: A Custom Keyboard Layout for OS X

A keyboard layout file sits between your physical keyboard and the operating system. It tells the computer what should happen when you hit a certain key on the keyboard, for example the key labeled “Z” or the combination of shift (), option () and 7.

Most common usage of keyboard layout files is to make language specific physical keyboards work as you would expect. If you bought, for example, your MacBook in France chances are high that the upper left letter keys are labelled “A” and “Z”, and not “Q” and “W” as on an US keyboard. And indeed, if you hit the upper left letter key on your French MacBook it’ll type the letter “A” into your text document. 

But this is not because of the letter printed on the keyboard. This is because your French MacBook comes with a French keyboard layout file (short: keyboard layout) pre-installed. The keyboard layout tells the computer that he has to type an “A”, and not a “Q”, every time you hit the upper left letter key.

[If you are familiar with keyboard layouts on the Mac you may directly jump down to the next section.]

Probably 95% of all users will use this pre-installed keyboard layout and never change it. You can see the active keyboard layout on your Mac if you go to System Preferences -> Keyboard -> Input Sources. In case of the French MacBook you’ll probably see exactly one active keyboard layout there: “French”. So, what happens in general is that most languages have one specific physical keyboard layout and one keyboard layout file that corresponds to that physical layout.

There are exceptions to this. If you have an US MacBook it is possible that you see two keyboard layouts in the Input Sources list: “U.S.” and “U.S. Extended”. (If the latter is not already there you can add it via the Plus button at the bottom of the list. Also make sure that “Show Input menu in menu bar” is selected.). For writing everyday-texts both layouts are perfectly usable and you won’t note any difference; both correspond perfectly to the letters and symbols printed on the physical US keyboard.

Keyboard System Preference Pane, Input Sources
Keyboard System Preference Pane, Input Sources

Where’s the difference then? You’ll start to see the differences if you use a modifier key like Option (). If you hit ⌥Z while the “normal” U.S. layout is active you’ll get the Greek letter Ω (Omega). Now activate the U.S. Extended layout (via the Input menu in the menu bar), hit ⌥Z and you’ll get a strange thing like ˀ. This is a glottal stop, mainly used in phonetic alphabets.

Keyboard layout selection: U.S. Extended

To see the whole repertoire of symbols you have at your disposal through the -key you have to open the Keyboard Viewer. You can do this by selecting “Show Keyboard Viewer” from the Input menu in the menu bar. With the Keyboard Viewer on-screen hold down the -key: you’ll see a lot of strange symbols that can all be typed while the -key is down.

Input menu: Show Keyboard Viewer

While you’re at it also try the other modifier keys. On the Mac we have three main modifiers: (shift), (option) and the combination of both, ⌥⇧. While the -key is mainly used for upper-case letters, the ⌥⇧-combo gives you another repertoire of strange symbols.

OK, if you’re not into linguistics most of these symbols are of rather limited use for you. But what’s interesting is the idea behind this “extended” keyboard layout: thanks to the modifier keys there’s plenty of “space” on the keyboard that we can make use of!

The Keyboard Layout

The U.S.-TF custom keyboard layout is based on the normal U.S. layout, but unlike the U.S. Extended layout it doesn’t specialize in exotic languages and phonetic alphabets.

It aims to provide…

  • Generic characters and symbols that are actually useful in “normal” texts
  • The whole array of spaces, hyphens and joiners available in Unicode
  • The whole set of composed fraction numbers
  • Superscript numbers.

The guideline was to…

  • not change the mapping of any chars that are printed onto the keys,
  • not change the mapping of the ¨´`˜ˆ diacritics (maintaining full compatibility with German, French, Spanish, Portuguese),
  • not change the position of frequently used -chars (©, ®, etc.), as far as possible,
  • maintain good mnemonics for most mappings and dead keys

Of course, what is of “useful in ‘normal’ texts” is a very subjective thing. To make place for what I considered useful I had to remove or displace some symbols that others may find useful, especially some mathematical symbols. So, this keyboard layout can perfectly treated as a template that you can further adapt to your personal needs.

I use this layout for…

  • German and English texts
  • Scripting, markup and TeX (that’s why I don’t use a German layout or keyboard anymore!)
  • Occasionally for Spanish and French texts

The layout makes use of multi-level dead keys (chained dead keys). This way it can hold way more characters than a “flat” keyboard layout.

Installation

  1. Download (1.1 / 2016-05-12)

  2. Unzip and drag the U.S.-TF.bundle file into ~/Library/Keyboard Layouts. (That’s in your Home folder.)
  3. Re-login to your account.
  4. Select the keyboard layout from the Input menu in the menu bar. (You may have to activate that menu in the Input Sources tab of the Keyboard Preference Pane).

Keyboard layout selection: U.S.-TF

Available Symbols and Chars

For each group I’ll give you first a thematically sorted list, then an overview by modifier key.

Letter-like, Currency and Diacritics

Currency
$ € £ ¢ ¥
Letterlike
œ æ ç Œ Æ Ç ß ® © ™ @ & ω Ω ƒ ª º №
Diacritics (dead keys)
´ ` ˜ ˆ ¨

No big changes here. A nice addition from the U.S Extended: .

I stripped out the “nordic” letters like å, Å, ø, Ø. (However, you can always, and independently of the keyboard layout, access them via the system’s Accent Menu.)

I removed the precomposed letters Á, Ó, Ô, Ò, Ú, Â, Í, Î, Ï; the latter were basically redundant since they can be composed via the diacritical dead keys.

For better accessibility I remapped the Euro symbol from ⌥⇧2 to ⌥2.

Symbols

Bullet-like (for outlines)
• ⁃ ◦ ■ □ ‣ ▸ ▹ · ◆ ◇
Stars
★ ☆
Arrows
→ ← ↔ ↓ ↑
Checkmarks & Checkboxes
✗ ✘ ✓ ✔︎ ☒ ☑︎ ☐
Mathematical & Units
× ÷ ∕ ⁄ − + ≤ ≥ √ ∑ ∆ ∞ ≈ = ≠ ± < > ° µ % ‰ π ′ ″
Punctuation
. , ; ‹ › « » ‘ ’ ‘ ‚ „ “ ” ” / – – — _ … ! ¡ ? ¿ ⸮ ‽
Other
§ & † ¬ ‡ ( ) [ ] { } | \

Some obvious additions here (stars, arrows, bullets, checkmarks), and some not so obvious: a real minus sign (U+2212), a multiplication sign × (U+00D7), a division slash (U+2215). The mnemonics are pretty easy: ⌥M for the minus sign, ⌥X for the multiplication, ⌥D for the division slash.

The last two in the Units section are the prime (⌥⇧E) and double prime (⌥⇧D). These are the correct symbols for feet, arcminutes and minutes (′), and respectively inches, arcseconds and seconds (″). The double prime can also be used as ditto mark.

Some “fun” symbols added: The reversed question mark (U+2E2E), sometimes used as an irony mark, and the infamous interrobang (U+203D), a combined !?.

I removed some specialized mathematical symbols like ∫, ∂, ∏, as I just haven’t any use for them. The same goes for our beloved apple (sorry, I literally never used this one in the last 30 years;-)

I removed other things like ˘, ¯, ˛, ¸ This is phonetic stuff and if you need these you are better served by switching to a specialized layout.

I’ve repositioned the German left double quote to ⌥P. It can be better reached there and it is just beside the right double quote on ⌥[ (which is the same sign as the English left double quote). So all the quotes are nicely grouped in the same region. (The German left single quote is unchanged on ⌥⇧0.)

Option key characters and symbols
Option key characters and symbols. The colored keys are the dead keys for diaeresis/umlaut, accents and tilde (unchanged from original layout).
Option-Shift key characters and symbols
Option-Shift key characters and symbols. The colored keys are the dead keys for superscripts (S), fractions (F) and spaces/special chars (spacebar). (See description below.)

Fractions

I’ve implemented the fractions as multi-level dead keys. It works like this: Hit the dead key ⌥⇧F (mnemonics: F for Fraction), then release the dead key, then enter the numerator, then the denominator. Example ⌥⇧F followed by 4 followed by 5 will produce .

Please note: release the dead key means that you have to release the -key, the -key and the F-key, not just the F-key!

Available vulgar fractions (via dead keys)
½ ⅓ ¼ ⅕ ⅙ ⅐ ⅛ ⅑ ⅒ ⅔ ⅖ ¾ ⅗ ⅜ ⅘ ⅚ ⅝ ⅞
Fractions for numerator 1
Available fractions after the dead key sequence ⌥⇧F + 1

Supercripts

These are also implemented as dead keys: First hit the dead key ⌥⇧S (mnemonics: S for Superscript), then release the dead key, then type the number/letter/symbol.

Available superscripts (via dead keys)
¹ ² ³ ⁴ ⁵ ⁶ ⁷ ⁸ ⁹ ⁰ ᵉ ⁿ ⁻ ⁺ ⁽ ⁾

The superscript parenthesis are achieved via ⌥⇧S plus [ (or ]).

Superscripts
Available superscripts after the dead key ⌥⇧S

Spaces and Special Chars

This is the part of the layout I use very often! Like the previous groups this is also based on a dead key (combo). The dead key here is ⌥⇧[spacebar] (mnemonics are obvious!). I think a little table can help here:

KeyCharUnicodeNameAlt. Key
1[ ]U+2003em spacem
2[ ]U+2002en spacen
3[ ]U+2004three-per-em space
4[ ]U+2005four-per-em space
5[ ]U+2009thin spacet
6[ ]U+2006six-per-em space
7[ ]U+200Ahair spaceh
8[​]U+200Bzero width spacez
9[⁠]U+2060word joinerw
0[‌]U+200Czero width non-joiner
[‑]U+2011non-breaking hyphen
=[­]U+00ADsoft hyphen
[space][ ]U+202Fnarrow no-break space
f[ ]U+2007figure space
p[ ]U+2008punctuation space

In the Char column I put brackets around the chars so you can actually “see” the spaces. As you see the principles are easy: the most common spaces can all be achieved via the dead key ⌥⇧[spacebar] followed by a number, where the number pretty good represents the amount of space the space character produces.

For example ⌥⇧[spacebar] followed by 1 produces a 1-em space, ⌥⇧[spacebar] 2 is a 2-per-em space (= en space) and so forth up to ⌥⇧[spacebar] 7 for the smallest of all spaces (hairspace). The next three are thinner than a hairspace, i.e. these are zero-spaces in different incarnations. Some of the spaces have alternate keys for better mnemonics, for example ⌥⇧[spacebar] H for a hairspace (see table).

A special case is the – very useful – Narrow No-break Space: it can be achieved with ⌥⇧[spacebar][spacebar]. I’ve mapped it like this to make it coherent with the normal no-break space, which is ⌥[spacebar] on the Mac.

The Soft Hyphen is very useful for web pages where you have set hyphens to “manual” in the CSS.

The Word Joiner can be used to glue something together that otherwise might be separated at a line break; for example a footnote marker following a period.

As with all dead keys it is important to release the dead key ( and and [spacebar]) before typing the following key.

For more info on the different spaces and joiners please see the Wikipedia.


Download (1.1 / 2016-05-12)

Download (Older versions / –)


Used Software

I’ve created the keyboard layout with the help of the excellent software Ukelele. If you want to modify the layout or create your own I highly recommend this program. It also comes with a very comprehensive manual that really helps you understand how keyboard layouts on the Mac work.


Changes
1.1 (2016-05-12)
Mapped ω (Lowercase Greek Omega) to ⌥Z. This is coherent with Ω on ⇧⌥Z. The Omega letters are useful for sorting something to the last position e.g. in the Finder. (Besides that, uppercase Omega is also used as unit symbol for Ohm.)
Remapped ‣ (Triangular Bullet) from ⌥Z to ⌥7. Easy to remember because it’s just to the left of the regular bullet (⌥8). Pilcrow ¶ (formerly on ⌥7) is gone.

Leave a Reply

Your email address will not be published.