See here for example: https://dailydoseoftech.com/how-to-create-a-custom-keyboard-...
EDIT: Some compelling arguments in favour of the app in this thread. Thank you
On the 1 key, I have 1 and !. Maybe I could add ¹ and ₁, with AltGr and Shift+AltGr (or Ctrl, or something). Maybe ½ and ¼?
With Compose, I have ¹, ₁, ½, ⅓, ¼, ⅕, ⅙, ⅐, ⅛, ⅑, ⅒, ①, ⑩, ⑪, … ㊶ which involve the 1 key. I do not need to look up the sequences for these, as they're intuitive: Compose ^ 1, Compose _ 1, Compose 1 2, … Compose ( 4 1 ).
EDIT: Actually, it seems Windows supports chained dead keys, so I think you could accomplish longer sequences with a plain old Windows keyboard layout definition too. But that's not supported with MSKLC.
side-note: X11 layouts are really frustrating. there's a hard constraint of one key combo -> one Unicode character, which makes it impossible to output multiple characters. I run into this with Lushootseed, which has /ƛ̕/ (glottalized barred lambda encoded as barred lambda + accent marker), but you'd never write it without the accent in that language.
The orthodox solution for this problem is an IME.
Quickest path to success is via editing a new map file /usr/share/m17n/lut.mim (see Blackfoot and Inuktitut in the same directory for examples of multiple character output) and then using the m17n plugin for fcitx or scim or ibus.
That's a good point about non-character keys though, I don't think that could be supported with this method.
Too bad that Qt broke support for that in version 5 and has never fixed it.
I use it all the time for typing arrows and other symbols, for example. YMMV but I also find it mnemonically better, from time to time I can just guess what the right Compose sequence is.