1

I'd like to know which character is output from which key, including with modifiers like ⌥ ⌘ ⇧ ⌃, including the character and its Unicode number.

Only the primary characters appear on my physical keyboard, but some less-known ones are produced with the modifiers.

This can actually be seen under System Preferences->Keyboard->Input Sources; Select language and then press modifier keys. However, I cannot screenshot the image of the keyboard with a modifier because the screenshot key-combination overrides the modifier key; and in any case this is a tiny image of the keyboard, whereas I would like a precise listing in text form.

Is this in a configuration file somewhere on my Macbook (2017 15 inch; OS 10.15.7), or can I output it with a certain command?


[Edit]: In addition to the answer below, using Ukelele, note this code which processes Ukelele output into a searcable document.

1
  • 1
    On screenshotting the keyboard viewer: as a workaround you could record the keyboard viewer with Quicktime (built-in) while you press the desired key combinations. After that you can extract/screenshot the desired frames. Commented Jan 6, 2021 at 14:56

3 Answers 3

2

The Ukelele app suggested in this answer can give you a printout of the keyboard layout for every combination of modifier keys in the form of keyboard diagrams (not a list unfortunately). The resulting diagram looks like this:

enter image description here

Follow below steps to get a diagram:

  1. Install and open Ukelele, you're greeted by the main window: main Ukelele window
  2. Open System Preferences → Keyboard → Input Sources and select the input source for which you want an overview. Alternatively select it in the menubar:
    enter image description here
  3. In Ukelele go to File → New From Current Input Source, this creates a copy of the keyboard layout:
    enter image description here
  4. Double click on it to open the keyboard layout in the main window.
  5. Press the Print button in the top right corner:
    enter image description here
  6. Actually print the overview or save it as a PDF (through the PDF dropdown in the lower middle of the print dialog).
  7. Repeat step 2 to 6 for any other input sources you need.
3
  • Thank you. Ukelele gives nicer images than the Keyboard Viewer. But more important, you can see the actual characters in textual (XML) form! Just choose File> Save and you get a directory. Then go to /<SAVE DIR>.bundle/Contents/Resources/<BUNDLE NAME>.keylayout and view an XML file. I might write a script to learn the Unicode chars (which would also give formal names for some exotic chars like different kinds of quote mark), but this XML is what I need.
    – Joshua Fox
    Commented Jan 6, 2021 at 16:53
  • 1
    Glad to be of help. I saw the XML, but thought it would be a nightmare to parse into a nicely readable list. If you end up writing a script, could you please share (the link to) it as an answer? Commented Jan 6, 2021 at 16:56
  • I wrote the code. You can see it, with an example output , at github.com/doitintl/mac-keymappings
    – Joshua Fox
    Commented Jan 9, 2021 at 17:43
3

Use Keyboard Viewer instead of the preferences pane.

Use the Screenshot app found in Applications/Utilities to create shots of the different modifier levels.

I don't know of any easy way to get the Unicode numbers. Perhaps the Ukelele app, which can make a copy of the current input source for analysis.

2
  • You can also screenshot the modes using the newer Cmd/shift/5 & a 5s delay, eg i.sstatic.net/eSqcl.png You can also use the 'emoji' viewer from the keyboard viewer to type one into the other for a rather convoluted way to get the unicode ;))
    – Tetsujin
    Commented Jan 6, 2021 at 15:27
  • Thank you! See also my comment under the answer by @Saaru Lindestøkke
    – Joshua Fox
    Commented Jan 6, 2021 at 16:54
0

This site provides a key-to-character mapping for the default US keyboard in Mac OSX.

1
  • Thank you. That is what I want, but that is only for the default US keyboard. I wonder if there is a way of generating such a mapping for any keyboard.
    – Joshua Fox
    Commented Jan 6, 2021 at 15:54

You must log in to answer this question.

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