How can I type unicode characters without using the mouse?

I want to type unicode characters with the keyboard. I'm looking for a solution with no mouse usage. For example, below I have a line with the unicode "PILE-OF-POO" character:

💩

The codepoint for PILE OF POO is U+1F4A9 and on a linux operating system I can create this character by typing:

Ctrl+Shift+u,

1, f, 4, a, 9

space

How can I do something similar on a mac keyboard? Other answers I've searched involve fiddling with menus and switching input sources.


Solution 1:

Press CTRL+CMD+space to bring up the characters popover.

Open character popover

Then type in the code point and press the down arrow to select the symbol.

Type in code point

Then simply press ENTER and you are done.

This also works with the names of the symbols (e.g. arrow).

Additional information:

Note the icon in the top right of the character popover. It changes the popover to the full Character Viewer, which cannot be navigated by the keyboard. Click the icon in the top right of the Character Viewer to return to the popover. Many thanks to @Tom Gewecke for this information.

Solution 2:

U+1F4A9 converts to d83d dca9 in unicode hex input, which is what OS X uses as an official input source across the OS.

To use the keyboard directly with their code numbers, first enable Unicode Hex Input in System Preferences -> Keyboard -> Input Sources. Then, each time you wish to use that input method, switch to the Unicode Hex layout (this can be done via a keyboard shortcut that by default conflicts with spotlight) and then hold the option/alt modifier while you type the the utf-16 hex codes you wish (which is really two hex codes for characters beyond the Unicode BMP, such as 1f4a9, which is represented by d83d dca9).

option held down then d, 8, 3, d, d, c, a, 9

A which point, you will have summoned 💩

Not much fun to type.

If you have a finite number of such characters you want to make, you can set up keyboard shortcuts for them in system prefs/keyboard/text in the substitutions table.

Solution 3:

In System Preference, select "Keyboard", then select "Input Sources". The left hand pane will show your preferred language keyboard, and possibly alternates. If Unicode Hex Input is not there, click the + button beneath; you will get a long list of languages. Scroll to the very bottom and choose others. Unicode Hex Input will appear in the right pane, then click the Add button, bottom right.

Tab over to Shortcuts and choose the shortcut key. AltSpace and CmdSpace may already be taken by Spotlight. Either disable them, or reassign by clicking at the right-hand end of the column and typing your new key. I left them as they were and assigned CtrlSpace for Input sources.

If you do that, now when you type CtrlSpace, you will see the little flag, top right of the menu bar change to a U+. You can then enter your hex codes (which you can find out from the Emoji & Character Viewer) by holding Alt while you type the numbers. E.g. for U+2282 SUPERSET OF taken from any lookup source, Alt2282 produced the Set member symbol ⊂.