51

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.

52

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.

  • 2
    I don't think this will work if you normally have the expanded version of the Character Viewer active. You have to use the mouse to get back to the small one you are showing. Or is there a keyboard shortcut to do that? – Tom Gewecke Jul 27 '17 at 10:26
  • That's right, this only works with the popover variant not the bigger window. – malte Jul 28 '17 at 9:40
  • 2
    How do you get the popover variant? Is there something similar on IOS? Having frequently used right at the top is great. – WGroleau Jul 29 '17 at 15:47
  • 3
    @WGroleau To get the popover, you click on the small icon in the top right corner of the expanded version. For iOS I think you could use an app like Unicode Pad itunes.apple.com/us/app/unicode-pad/id374098312?mt=8 – Tom Gewecke Jul 29 '17 at 16:04
  • 1
    I had to use the mouse to get the cursor inside the search box of the popover. Keyboard focus was still in the application and not in the popover. I have a bunch of keyboard mods, like SizeUp and Karabiner, going, so I am not sure about the default behavior. – Reb.Cabin Sep 6 '17 at 12:20
39
+50

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.

  • 1
    substitutions could be an acceptable workaround. I tried setting up a substitution for pileofpoo -> 💩 , but it isn't doing anything. Could you add more details of how/where this is supposed to work? – wim Apr 29 '15 at 5:33
  • 2
    No, trying in text boxes in the browser, in jetbrains IDE , in the built-in terminal app, sublime text ... not working in any of those – wim Apr 29 '15 at 22:30
  • Can you input that character using the Character Viewer in those apps? – Tom Gewecke Apr 29 '15 at 23:16
  • 2
    If you don't enable unicode hex input, you get ∂•£∂∂çåª output. @bmike your edits are confusing the post a bit and should be reordered. – wim Sep 23 '15 at 12:08
  • 2
    For those not familiar with using the surrogate characters (UTF-16), the conversion is like this: 1f4a9 -> f4a9 -> 03d,0a9 -> d800+03d,dc00+0a9 -> d83d,dca9 Subtract 0x10000, High/Low ten bits, Add Hi/Lo surrogate bases – dmaestro12 Sep 29 '16 at 13:53
12

Hard to find in Sierra. In System Preference, select Keyboard, then select InputSources. 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. Alt+Space and Cmd+Space 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 Ctrl+Space for Input sources. If you do that, now when you type Ctrl+space, 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. Eg, At2282 produced the Set member symbol ⊂.

  • When adding the input source, after pressing the + at the bottom of the screen instead of scrolling to the bottom you can enter "unicode" in the search field and it should show you the Unicode Hex Input as a result. Confirmed to work on macOS 10.12 – ekscrypto Apr 17 '17 at 15:29
  • At least on Mac OS 10.11 there's an option in System Preferences to show input sources in the menubar, so it's easy to switch (of course using your mouse). – z80crew Sep 1 '17 at 9:46
  • I got this all turned on. Now when I type option d83ddca9 I see nothing until I type one more character, such as 0, 1, ..., e. Option d83ddca90 yields 쪐, option d83ddca91 yields 쪑, ... option d83ddca9e yields 쪞. With all that Hangul, there must be a pile-of-poo somewhere. – Reb.Cabin Sep 6 '17 at 12:34
  • @Reb.Cabin Do you have that problem here? I don't 💩 – Tom Gewecke Sep 6 '17 at 18:21
  • @TomGewecke must have been a glitch my side. it's working for me now. – Reb.Cabin Sep 21 '17 at 15:24

You must log in to answer this question.

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