On 10/07/2019, Ingo Schwarze <schwa...@usta.de> wrote: > Hi Ian, > > ropers wrote on Wed, Jul 10, 2019 at 03:03:08AM +0200: > >> I intend to write feature "altnumd" and would like advice for how to >> go about it. > > My opinion is that we don't have too few methods for entering > characters. One could argue that we already have too many, > and the existing ones are too complicated. So writing yet > another system or daemon sounds like a bad idea to me. > > 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. > > I'm not aware of a simple method of entering Unicode codepoints > numerically that works everywhere, and i find that lack annoying. > > Yours, > Ingo
While I'm personally only or mainly interested in Alt+numeric input, if altnumd existed, it would probably be comparatively easy to then extend it and add support for Alt+u0000 thru Alt+u10ffff, with the U becoming a reserved keyword unambiguously signifying that what follows will be a Unicode code point between U+0000 and U+10FFFF. Maybe this is the hubris born of inexperience and ignorance speaking, but I think that would be the easiest part. [1] I think capturing keypresses would be harder, but the existence of sxhkd, etc. suggests this is solvable, at least on X11 (though I'd love to have something that works just the same on console). The hardest part that I'm comprehensively clueless about is how or where or what exactly to insert into the, or what, keyboard buffer. So I think maybe our interests are aligned for the moment. There's a huge competence gap between us, but I think on this part of the possible journey, we'd have to go the same way. Any hints on how to even start with that hardest part, or what to read or where to look would be MORE than welcome. Cheers, Ian [1] Okay, sorry, I lied: What'd be somewhat easy would be putting the *plumbing* for Alt+u<codept> in place ONCE the plumbing for Alt+<decimal> exists. I imagine the latter as being based on a simple .altnumrc that's a configurable list of key-value pairs. Creating a list of keys from 0 thru 255 with the corresponding values for e.g. code page 437 would be relatively easy, HOWEVER creating or maintaining anything close to a semi-comprehensive list for just about every Unicode character you can think of would actually be very hard. My thinking is to more or less leave that work to users: altnumd would read .altnumrc on (re)launch, and users could create and swap out different versions of .altnumrc e.g. to switch from CP437 to WinCP1252 or ISO-8859-1 or whatever. A thinly populated .altnumrc for initially just the lowest Unicode blocks[2] in the Basic Multilingual Plane[3] would still be easy to make, but with higher expectations of how comprehensive an .altnumrc you want to support and maintain, the difficulty goes up exponentially. And that's not even mentioning font support, etc.[4] The trick is not to include every combination but only those Alt codes (or code points) you'll actually use. [2] https://en.wikipedia.org/wiki/Unicode_block [3] https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_Multilingual_Plane [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.