[Tux4kids-tuxtype-dev] Better support for Greek keyboard layout
alkisg at gmail.com
Fri Nov 16 20:12:02 UTC 2012
Hi, we (a few Greek teachers) are working on updating the Greek theme,
after contacting the previous maintainer which currently has no time to
work on tuxtype.
So far I've updated keyboard.lst and el.po and added phrases.txt, and 2
others are translating the scripts (lessons), words etc:
Also we've done a minor change in alphabet.c to align the letters more
accurately on the keyboard:
We'll file a merge proposal (is bzr OK or git is preferred?) when
everything is ready, but in the meantime could someone provide some
feedback on a problem we're facing?
The Greek keyboard layout has a few "weird" methods for character input,
which we can't express with the current keyboard.lst format.
Here's a screenshot of the Greek keyboard layout in tuxtype that should
help while reading the rest of the mail:
1) The layout is "us,gr", which means that to type e.g. "Ρυθμίσεις
Onboard", the user types "Ryum;iseis" on the keyboard, then Alt+Shift to
switch languages, and finally types "Onboard".
Of course re-drawing the whole keyboard (either Greek or English) when
the user changes his input language would be asking too much.
And there's not enough space in the keyboard.png keys to draw both Greek
and English characters at the same time, so this wouldn't display well:
What we want there is to be able to express in keyboard.lst where the
english characters are on the keyboard, so that the red rectangles (e.g.
keyboard_A01.png) do appear for them, but without the characters
themselves being drawn. One way to implement that is to remember that
some character ("Δ" in the example above) was already drawn in the place
where "D" is on the keyboard, and not draw any others after it (so "D"
in the example above wouldn't be drawn).
2) Some characters are entered by holding down the Right Alt key, e.g.
the euro sign "€" is produced by R_Alt+e. To solve this, we'd like to
implement a state for Alt in alphabet.c -> GetKeyShift().
But that would also require an addition in keyboard.lst and in
alphabet.c -> map_keys(), e.g.
where the last "4" would manually represent the shift state.
3) The most difficult part is displaying the keys for the accents (tonos
and dialytika) for Greek vowels. E.g. to produce "ώ" one types ";" first
and "v" afterwards. But there are more extreme cases, e.g. "Ϋ" needs
"Shift+;" and "Shift+Y".
I'm not sure if SDL produces an event for the tonos key or if it's a
dead key. xev says:
state 0x2000, keycode 47 (keysym 0xfe51, dead_acute), same_screen YES,
XLookupString gives 2 bytes: (c2 b4) "´"
It would be enough though to mark it similar to the Shift, Alt or Ctrl
(1=Left shift, 8=tonos)
I think we could propose a patch that implements all of the above, if
they sound sane enough to be accepted upstream.
Whew, long mail, thanks a lot for reading it. :)
More information about the Tux4kids-tuxtype-dev