Hacker News new | ask | show | jobs
by tgflynn 1041 days ago
Does anyone know of a good resource explaining how the compose key is supposed to work in general beyond the simple cases like those discussed in this article ?

I have an interest in some less spoken languages like Ancient Greek and Sanskrit and though there are specific keyboard layouts that mostly work there are still some less common combinations of diacritics used in writing Ancient Greek, for example, that don't seem to be covered.

Is there some way to use the compose key for entering general Unicode sequences for example, that would work for different applications ?

I'm a Linux user but I'd be interested in seeing a solid exposition on this topic even if it was for a different OS.

1 comments

(Author/OP here.)

That is an interesting question.

Step 1, be operating in the basic alphabet.

Step 2, work out the necessary modifiers on top of that.

This is... harder than it looks.

Q: Are there keyboard layouts for Ancient Greek, or for Sanskrit?

A: Yes, e.g.

https://help.keyman.com/keyboard/greekclassical/1.2/greekcla...

http://prakrit.info/keyboard.html

BUT they may already have their own systems for diacritics, as these do.

I note that the Sanskrit one here uses dead keys, which I personally hate.

Second note: dead keys are responsible for the very common issue of Eastern European keyboard users trying to type English on layouts with an acute accent key, and using the accent for an apostrophe. If you know the difference the result looks terrible, especially in any and all proportionally-spaced fonts.

In other words the core (key, haha) problem here is lack of uptake of the Compose key by IBM when designing the PC, so meaning it is not generally known and people design fancy new layouts because they don't know this is an option.

Yeah, I was hoping to find some general information on how the Compose key is (or was) supposed to work. It's easy to find info on how to assign the Compose key to a particular key but I haven't found anything on how to actually use it to input more or less complex character codes.

Part of the problem may also be the difference between precomposed and non precomposed glyphs in Unicode, which I don't really understand, but it seems that if a keyboard layout is designed to use precomposed glyphs it may not allow you to further compose those with other code points.

For example there is a character that is a lowercase alpha with both an acute accent and a macron on top. With the right font it displays correctly (it probably wouldn't if I tried to copy-paste it here) but I don't know how to enter it on the keyboard. I suspect that's because there's no precomposed Unicode codepoint for it and my keyboard layout only seems to work with those.

The correct encoding for it is "GREEK SMALL LETTER ALPHA WITH MACRON" (Unicode name) composed with "'".

Well, here's a story about how to configure and use one that I wrote last year:

https://www.theregister.com/2022/01/07/foss_fest_foreign_let...

It's dead easy.

You type compose, then 2 (or very occasionally 3) characters which, put together, make the letter you want.

Compose, a, ` gives à. Compose, A, ` gives À.

And so on. Y,=, ¥. c,/,¢

You can usually guess the combination you need.

Yeah, that might work with a default keyboard layout but it doesn't work with a polytonic Greek layout. How would you type a lowercase alpha with an acute accent and a macron that way ?
I don't speak or write Greek, so I don't really have any insight at all into this. (I can just about, very poorly, read the alphabet, that's all.)

So I can only guess:

Let's assume we have a Greek layout. And that that has keys from alpha to omega, and a RightAlt or something, and keys that have some useful resemblance to acute, grave, circumflex, rough, smooth, etc.

Compose, type an alpha, type an apostrophe?

As an example, I sometimes type in Czech.

č is comp, c, < š is comp, s, <

Others...

î is comp, i, ^ ï is comp, i, "

ç is comp, c, comma

All that's needed is a vague visual resemblance to the desired diacritic.