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.