On 11/07/2019, Matthew Graybosch <mgraybo...@fastmail.com> wrote: > On Thu, 11 Jul 2019 00:41:45 +0200 > ropers <rop...@gmail.com> wrote: > >> Any hints on how to even start with that hardest part, or what to read >> or where to look would be MORE than welcome. > > Hi, ropers. I've been reading this thread about altnumd and using > alt+000 to enter arbitrary Unicode characters like people did on DOS > and Windows. I noticed that nobody mentioned that X11 already has a > method for entering arbitrary Unicode characters using pre-defined key > sequences. It's called the "Compose" key (aka the Multi_Key in X11 > header files).
I mentioned that, somewhat near the top of my earlier email: >> I am very aware of the Compose key support in X11, and this isn't >> about that. This isn't about inputting characters in a good or better >> way. This is about inputting characters in exactly THAT way >> (Alt+Numpad), "just like mammy used to". However, I didn't go into details, and though Compose doesn't solve what I want to do, you're right that these details may help somebody, so thanks anyway. > https://en.wikipedia.org/wiki/Compose_key > > PC and Mac keyboards don't provide a physical compose key, but you can > remap a key you don't usually use (like Caps Lock or the right-hand ALT > or CTRL keys) using setxkbmap(1). > > Here's the command I use in my ~/.xsession file: > > setxkbmap -option compose:caps & > > Hopefully this helps somebody. (Personally, I like to use compose:rwin, though that right Windows key doesn't exist on some (old or laptop) keyboards.) I'm pretty damn sure Ingo knows about Compose too. His complaint was subtly different also: > > I'm not aware of a simple method of entering Unicode codepoints > > numerically that works everywhere, and i find that lack annoying. Emphasis on "that works everywhere". I am aware of the "Ctrl+Shift U <codept>" Unicode input method too, but this again does not work everywhere: <https://en.wikipedia.org/wiki/Unicode_input#In_X11_(Linux_and_Unix_variants)> However (this also from my above email): >> [4] Also, the console would only support a small subset anyway; I have some questions and thoughts on that too, but that's really another issue for another day, perhaps. Plus, Ingo wrote: > > What might be useful is understanding all the details of how > > all the existing methods in ws* and X* (and possibly elsewhere?) > > work, then simplify them. Even if Ingo's interest in understanding and simplifying existing methods, --and arguably Alt codes *are* an existing method, albeit one that works "elsewhere" but not on Unix-likes thus far--, could be partially aligned with what I want to do, and would hopefully be simplifying things instead of being like the invention of another text editor <http://www.catb.org/esr/writings/unix-koans/editor-wars.html>, Unicode support on console would necessarily be limited. I alluded to that in my [4] footnote, and maybe I should write up my extensive thoughts on that, Real Soon Now. The major limitation there is that console font support is limited to 256 characters, or hackishly 512, and the ways around that are not pretty. So while Alt+<numpad>, and *perhaps* also Alt+u<codept> could possibly be made to work the same throughout X11 and console, Alt+u<codept> would be limited on console. I am aware that Alt+u<codept> would compete with Ctrl+Shift U<codept> (which latter doesn't work everywhere). Either way, actual Unicode character input methods like this, and let's include Compose here, could perhaps only *input* characters like, say, the ☃ U+2603 SNOWMAN, but the console would at best *display* \xE2\x98\x83 in place of that, because the Unicode snowman is not in any console font. If we want to be precise about it, console "support" for *displaying* a character that was typed is a different issue than inputting it though, and being limited to a subset here and there shouldn't count against the idea of installing universal plumbing. And again, to me the hardest part of that is figuring out >> how or where or what exactly to insert into the, or what, keyboard buffer. >> (...) >> Any hints on how to even start with that hardest part, or what to read or where to look would be MORE than welcome. Many thanks in advance, Ian