Tag : layout

Avestan keyboard layout

According to Wikipedia,

Avestan (pronounced /əˈvɛstən/ [1]) is an Iranian language known only from its use as the language of Zoroastrian scripture, i.e. the Avesta, from which it derives its name. The language must also at some time have been a spoken language, but how long ago that was is unknown. Its status as a sacred language ensured its continuing use for new compositions long after the language had ceased to be a living language.

Only recently was the Avestan script added to the Unicode standard (Unicode 5.2). For more, see page 17 at the Archaic scripts section of Unicode 5.2 (PDF) and the Unicode block details for U+10B00. See also the proposal to add Avestan to Unicode as an archaic script.

A user from UbuntuForums.org asked for help to create a keyboard layout for the Avestan script.

Keyboard Layout - Avestan

After providing the necessary details, the keyboard layout was created, Avestan keyboard layout for Linux.

So, how can you use the new keyboard layout?

1. Add avestan.txt at the end of /usr/share/X11/xkb/symbols/ir

sudo gedit /usr/share/X11/xkb/symbols/ir

in order to open (as administrator) the ‘ir’ layout, and paste the contents of avestan.txt at the end of the ‘ir’ file. Click Save and exit.

2. Register the new ‘avestan’ layout in evdev.xml and base.xml files.

Both files have a section that looks like the following. Do a simple search for ‘ku_ara’ or some other string in order to find the segment.

        <variant>
          <configItem>
            <name>ku_ara</name>
            <description>Kurdish, Arabic-Latin</description>
            <languageList><iso639Id>kur</iso639Id></languageList>
          </configItem>
        </variant>
-----------HERE------------
      </variantList>
    </layout>
    <layout>
      <configItem>
        <name>iq</name>
        <shortDescription>Irq</shortDescription>
        <description>Iraq</description>
        <languageList><iso639Id>ara</iso639Id>
                      <iso639Id>kur</iso639Id></languageList>
      </configItem>

Open base.xml with

sudo gedit /usr/share/X11/xkb/rules/base.xml

Then open evdev.xml with

sudo gedit /usr/share/X11/xkb/rules/evdev.xml

Replace the ‘———–HERE————‘ with the following lines:

 <variant>
 <configItem>
 <name>avestan</name>
 <description>Avestan</description>
 <languageList><iso639Id>ae</iso639Id></languageList>
 </configItem>
 </variant>

What we do here is we insert a variant description for the ‘avestan’ keyboard layout.

Click Save and exit the text editor.

3. Install a suitable font. Follow the steps from http://www.bomahy.nl/hylke/blog/adding-fonts-in-gnome/
which says to install the font in your home directory, in a ‘.fonts’ subdirectory. Normally, Ubuntu will pick up the font as soon as you copy it in there. Any newly started application should be able to use the new font.

4. Finally, add the new Avestan keyboard layout. Go to System → Preferences → Keyboard → Layouts, click on the [Add…] button and select from the list ‘Iran’ and layout ‘Avestan’. Click OK. Notice the new keyboard layout indicator on the panel that allows you to switch between English and Avestan.

Increasingly more scripts and symbols are added to the Unicode standard. These scripts are not useful unless there is a comfortable way to type in them. Find a script you like and help create a keyboard layout.

Εναλλακτικές διατάξεις πληκτρολογίου για ελληνικά

Ο Νίκος Μουτσανάς έφτιαξε δύο εναλλακτικές διατάξεις πληκτρολογίου που μπορεί να φανούν χρήσιμες σε όσους

  1. γράφουν συχνά σε διάφορες λατινικές (ευρωπαϊκές) διατάξεις πληκτρολογίου και θέλουν μια κοινή συγκεντρωτική διάταξη
  2. θέλουν μια ελληνική διάταξη που να επιτρέπει και αγγλικά με τη χρήση του AltGr (δηλαδή μια διάταξη για ελληνικά και αγγλικά)

Είναι πιθανό κάποιες από τις παραπάνω εκδοχές να μπορούν να υλοποιηθούν με χρήση παραμέτρων στη ρύθμιση πληκτρολογίου.

Ωστόσο, για τώρα, δείτε τις οδηγίες του Νίκου για τη ρύθμιση των δύο εναλλακτικών διατάξεων πληκτρολογίου. Διατηρήστε αντίγραφα ασφαλείας των αρχείων που θα τροποποιήσετε, σε περίπτωση που θέλετε επαναφέρετε τις προηγούμενες ρυθμίσεις. Δυστυχώς δεν υπάρχει ακόμα κάποιο σύστημα όπου να μπορούμε να προσθέτουμε εύκολα διατάξεις πληκτρολογίου στη διανομή μας.

The Keyboard Layout Editor

Update Dec 2010: Get the latest version of the Keyboard Layout Editor from https://github.com/simos/keyboardlayouteditor

(this entry is a repost, the original was lost in a database mishap.)

As part of the 2008 GSoC program, I worked on a Keyboard Layout Editor for the X.Org Foundation.

The Keyboard Layout Editor (KLE) is an application that allows you to create keyboard layouts for the X.Org server, commonly found in the Linux, OpenSolaris, *BSD, etc Desktops.

My mentor was Sergey Udaltsov, maintainer of xkeyboard-config, the Keyboard Indicator applet in GNOME, supporting libraries for keyboard layouts and much more. I had great help and Sergey was very supportive. Highly recommended mentor for your GSoC’09 project.

The Keyboard Layout Editor showing a layout

The Keyboard Layout Editor showing a layout

The screenshot above shows the main window of the program; a keyboard with blank layout (keys are empty), a section Add to layout with items that can be used to populate the layout, and a section for the description of the layout (Layout details).

There are typically two workflows; first you start off with a blank layout and you add Unicode characters, dead keys, include files, then you save.

The other workflow is to start with an appropriate existing layout as a base, then add more characters, make changes, etc.

It might be strange to talk about different workflows, but in terms of usability it’s important provide assistance for such cases. For example, having tooltips is important when a person starts off with a new layout.

Using the Keyboard Layout Editor

Using the Keyboard Layout Editor

Here we started with a blank layout; we click on Start Character Map, then locate the characters you need, and drag and drop them to the appropriate keys. Each key is composed of four parts, and we number these from 1 to 4. The way we count is quite peculiar,

  1. bottom left, when you press the key as is (key)
  2. top left, when you press the key with Shift (Shift + key)
  3. bottom right, when you press the key with AltGr (AltGr + key)
  4. top right, when you press the key with Shilft+AltGr (Shift + AltGr + key)
Analysis of a key

Analysis of a key

This is my entry to the most engineered diagram competition.

The dead keys relate to diacritic marks such as grave and acute. Since they are too small to see, we present them next to a D letter (D for Dead key). In some cases I could not find a character equivalent to the diacritic mark, so I put ?, therefore it looks like D?. If you put the mouse pointer over the key, you can see the full details in the tooltip.

Including files

Including files

In many cases, there exist layouts/variants that contain most of the characters you want to add. In this case, you add and enable in the Include files section. You can then override any of those characters by dragging and dropping to the layout.

At this stage in the blog post, it is important to clarify the notions of a layout and a variant. The two are quite similar and the distinction is messy when trying to explain to the end-user. The French layout file is fr, which contains several variants (distinct groups of mappings of physical keys to Unicode characters). When you are actually talking about a French keyboard layout, you are actually referring to the default variant of the «fr» file. Oftentimes people refer to the «fr» file as a whole as the French layout. You can also pick a non-default variant of the layout file, and call it your layout.

The way I would like to define layout and variant is this: a layout refers to the default variant of the layout file. This is consistent to the fact that distributions pick the default variant in the settings so it’s what get the most visibility, or when users select a new layout, they are presented with the default setting first. Regarding layouts in general, it is important for different languages/scripts to make effort that the default layout is updated and includes extra useful and relevant characters.

The new Greek keyboard layout

The new Greek keyboard layout

This is the updated Greek keyboard layout, and is the near-final version that we are planning to submit to xkeyboard-config. It adds Greek Polytonic to the existing Greek layout.  It does not make changes to the previous default layout, so users will not be unpleasantly surprised. It also adds all sort of characters that are found in the Greek Unicode block.

In this post I simplified some of the terms/description. If I went a bit too far, please correct me and I’ll update in-place.

Update 8th Sep 08: What are the plans for further development of the layout editor;

  • Increase the user base and get more people trying out the editor. This requires some more cleanup of the code, more instructions on how to run it youselves, and get people to provide feedback. An open-source project without users is not a successful project.
  • Make it easier for developers to contribute on the project. If you use Eclipse, you can install pydev, antlr3ide, mylyn, subclipse, and you can do the full development from within the cozy Eclipse environment. These need documentation.
  • The Issues page at the project has about ten items. This list needs to be reduced.
  • The natural place for users of the layout editor is the http://listserv.bat.ru/xkb/List.html mailing list. We need to promote the editor there, and get examples of users actually using it to maintain layouts.
  • An issue that plagues some users is when they need compose sequences to generate characters that no pre-composed forms exist. If users really need this (mainly Latin and Cyrillic scripts, complex scripts), it can be adapted to the UI.
  • It is technically easy to adapt the editor so that it produces XML layouts. Considering the state of XKB-atkins, this may not be a top priority at the moment. libxml2 comes with the MIT license, so in license terms it would be OK. Not sure if it is OK to link libxml2 to the X.org server. It might actually solve the slow parsing of the configurations files and the issues of xkbcomp.
  • At the moment the default geometry is a somewhat generic keyboard. In addition, I deactivated several keys (such as the function keys), in order not to confuse users (you can activate with a small change in the code). The keyboard can be expanded to a full 105-keys style. A related project would be to figure out an efficient way to edit those geometry files, and make the keyboard customised. If people start creating layouts with the editor, they will certainly love to edit geometry files!

Layout editor keyboard

This is a screenshot of the keyboard for the layout editor. The keyboard is a widget which is composed of individual widgets of each key.

I did not use glade-3 for the keyboard at this time. Although it is possible to create custom widgets in Python and install them in Glade, the current distributed packages are missing something, thus it would be messy when others try to use the editor. It’s a good experience to do all by hand anyway.

When creating a layout, you drag and drop characters on the keyboard. The editor shows a table with characters though it would be possible to drag characters from gucharmap as well.

The next step is to get an intuitive UI so that when you drop a character on a key, the key expands (a popup appears) showing the available four positions to receive the character.

Keyboard layout editor UI concept

(click for bigger image)

At the top we select the keyboard layout file, the variant, and set the corresponding verbose name.

The keyboard layout editor shows a standard keyboard, where each keyboard key can show up to four levels. When you select a key, the bottor-left window shows the characters that have been set (here we use four levels). In this bottom-left window we can drag and drop characters (from Unicode blocks) and dead keys that are found from the right of the image. Dead keys are shown in red boxes.

The user is also able to include existing keyboard layout files in the current layout.

At this stage I am thinking how to easily draw the keyboard in a PyGTK application. It would be important not to draw it manually. It would be cool to have a GTK+ keyboard key widget, that you can specify the size, and the text that appears on it, then build a keyboard in Glade. Another option would be to have the basic keyboard as an SVG file (already exists), then draw over it with Cairo. I am inclined for the second option.

Converting between XKB and XML

I completed the stage that takes keyboard layout files from XKB (X.Org) and converts them to XML documents, based on a keyboard layout Relax NG schema. Then, these XML documents can also be converted back to keyboard layout files.

Here is an imaginary example of a keyboard layout file.

// Keyboard layout for the Zzurope country (code: zz).
// Yeah.

partial alphanumeric_keys alternate_group hidden
xkb_symbols "bare" {
   key <AE01> { [        1, exclam,      onesuperior,  exclamdown      ] };
};

partial alphanumeric_keys alternate_group
xkb_symbols "basic" {
   name[Group1] = "ZZurope";

   include "zz(bare)"

   key <AD04> { [        r, R,           ediaeresis,   Ediaeresis      ] };
   key <AC07> { [        j, J,           idiaeresis,   Idiaeresis      ] };
   key <AB02> { [        x, X,           oe,           OE              ] };
   key <AB04> { [        v, V,           registered,   registered      ] };
};

partial alphanumeric_keys alternate_group
xkb_symbols "extended" {
    include "zz(basic)"
    name[Group1] = "ZZurope Extended";
    key.type = "THREE_LEVEL"; // We use three levels.
    override key <AD01> {   type[Group1] = "SEPARATE_CAPS_AND_SHIFT_ALPHABETIC",
[ U1C9, U1C8], [  any,   U1C7 ]   }; // q
    override key <AD02> {   [ U1CC, U1CB, any,U1CA ],
type[Group1] = "SEPARATE_CAPS_AND_SHIFT_ALPHABETIC" }; // w
    key <BKSP> {
        type[Group1]="CTRL+ALT",
        symbols[Group1]= [ BackSpace,   Terminate_Server ]
    };
    key <BKSR> { virtualMods = AltGr, [ 1, 2 ] };
    modifier_map Control { Control_L };
    modifier_map Mod5   { <LVL3>, <MDSW> };
    key <BKST> { [1, 2,3, 4] };
};

When converted to an XML document, it looks like

<?xml version="1.0" encoding="UTF-8"?>
<layout layoutname="zz">
  <symbols>
    <mapoption>hidden</mapoption>
    <mapoption>xkb_symbols</mapoption>
    <mapname>bare</mapname>
    <mapmaterial>
      <tokenkey override="False">
        <keycodename>AE01</keycodename>
        <keysymgroup>
          <symbolsgroup>
            <symbol>1</symbol>
            <symbol>exclam</symbol>
            <symbol>onesuperior</symbol>
            <symbol>exclamdown</symbol>
          </symbolsgroup>
        </keysymgroup>
      </tokenkey>
    </mapmaterial>
  </symbols>
  <symbols>
    <mapoption>xkb_symbols</mapoption>
    <mapname>basic</mapname>
    <mapmaterial>
      <tokenname name="ZZurope"/>
      <tokeninclude>zz(bare)</tokeninclude>
      <tokenkey override="False">
        <keycodename>AD04</keycodename>
        <keysymgroup>
          <symbolsgroup>
            <symbol>r</symbol>
            <symbol>R</symbol>
            <symbol>ediaeresis</symbol>
            <symbol>Ediaeresis</symbol>
          </symbolsgroup>
        </keysymgroup>
      </tokenkey>
      <tokenkey override="False">
        <keycodename>AC07</keycodename>
        <keysymgroup>
          <symbolsgroup>
            <symbol>j</symbol>
            <symbol>J</symbol>
            <symbol>idiaeresis</symbol>
            <symbol>Idiaeresis</symbol>
          </symbolsgroup>
        </keysymgroup>
      </tokenkey>
      <tokenkey override="False">
        <keycodename>AB02</keycodename>
        <keysymgroup>
          <symbolsgroup>
            <symbol>x</symbol>
            <symbol>X</symbol>
            <symbol>oe</symbol>
            <symbol>OE</symbol>
          </symbolsgroup>
        </keysymgroup>
      </tokenkey>
      <tokenkey override="False">
        <keycodename>AB04</keycodename>
        <keysymgroup>
          <symbolsgroup>
            <symbol>v</symbol>
            <symbol>V</symbol>
            <symbol>registered</symbol>
            <symbol>registered</symbol>
          </symbolsgroup>
        </keysymgroup>
      </tokenkey>
    </mapmaterial>
  </symbols>
  <symbols>
    <mapoption>xkb_symbols</mapoption>
    <mapname>extended</mapname>
    <mapmaterial>
      <tokenname name="ZZurope Extended"/>
      <tokeninclude>zz(basic)</tokeninclude>
      <tokentype>THREE_LEVEL</tokentype>
      <tokenmodifiermap state="Control">
        <keycode value="Control_L"/>
      </tokenmodifiermap>
      <tokenmodifiermap state="Mod5">
        <keycodex value="LVL3"/>
        <keycodex value="MDSW"/>
      </tokenmodifiermap>
      <tokenkey override="True">
        <keycodename>AD01</keycodename>
        <keysymgroup>
          <symbolsgroup>
            <symbol>U1C9</symbol>
            <symbol>U1C8</symbol>
          </symbolsgroup>
          <symbolsgroup>
            <symbol>any</symbol>
            <symbol>U1C7</symbol>
          </symbolsgroup>
          <typegroup value="SEPARATE_CAPS_AND_SHIFT_ALPHABETIC"/>
        </keysymgroup>
      </tokenkey>
      <tokenkey override="True">
        <keycodename>AD02</keycodename>
        <keysymgroup>
          <symbolsgroup>
            <symbol>U1CC</symbol>
            <symbol>U1CB</symbol>
            <symbol>any</symbol>
            <symbol>U1CA</symbol>
          </symbolsgroup>
          <typegroup value="SEPARATE_CAPS_AND_SHIFT_ALPHABETIC"/>
        </keysymgroup>
      </tokenkey>
      <tokenkey override="False">
        <keycodename>BKSP</keycodename>
        <keysymgroup>
          <symbolsgroup>
            <symbol>BackSpace</symbol>
            <symbol>Terminate_Server</symbol>
          </symbolsgroup>
          <typegroup value="CTRL+ALT"/>
        </keysymgroup>
      </tokenkey>
      <tokenkey override="False">
        <keycodename>BKSR</keycodename>
        <keysymgroup>
          <symbolsgroup>
            <symbol>1</symbol>
            <symbol>2</symbol>
          </symbolsgroup>
          <tokenvirtualmodifiers value="AltGr"/>
        </keysymgroup>
      </tokenkey>
      <tokenkey override="False">
        <keycodename>BKST</keycodename>
        <keysymgroup>
          <symbolsgroup>
            <symbol>1</symbol>
            <symbol>2</symbol>
            <symbol>3</symbol>
            <symbol>4</symbol>
          </symbolsgroup>
        </keysymgroup>
      </tokenkey>
    </mapmaterial>
  </symbols>
</layout>

When we convert the XML document back to the XKB format, it looks like

hidden xkb_symbols "bare"
{
	key <AE01> { [ 1, exclam, onesuperior, exclamdown ] };
};

xkb_symbols "basic"
{
	name = "ZZurope";
	include "zz(bare)"
	key <AD04> { [ r, R, ediaeresis, Ediaeresis ] };
	key <AC07> { [ j, J, idiaeresis, Idiaeresis ] };
	key <AB02> { [ x, X, oe, OE ] };
	key <AB04> { [ v, V, registered, registered ] };
};

xkb_symbols "extended"
{
	name = "ZZurope Extended";
	include "zz(basic)"
	key.type = "THREE_LEVEL";
	modifier_map Control { Control_L };
	modifier_map Mod5 { <LVL3>, <MDSW> };
	override key <AD01> { [ U1C9, U1C8 ], [ any, U1C7 ], type = "SEPARATE_CAPS_AND_SHIFT_ALPHABETIC"  };
	override key <AD02> { [ U1CC, U1CB, any, U1CA ], type = "SEPARATE_CAPS_AND_SHIFT_ALPHABETIC"  };
	key <BKSP> { [ BackSpace, Terminate_Server ], type = "CTRL+ALT"  };
	key <BKSR> { [ 1, 2 ], virtualMods = AltGr  };
	key <BKST> { [ 1, 2, 3, 4 ] };
};

Some things are missing such as partial, alphanumeric_keys and alternate_group, which I discussed with Sergey and he said they should be ok to go away.

In addition, we simplify by keeping just Group1 (we do not specify it, as it is implied).

I performed the round-trip with all layout files, and all parsed and validated OK (there is some extra work with the level3 file remaining, though).

Some issues that are remaining, include

  • Figuring out how to use XLink to link to documents in the same folder (+providing a parameter; the name of the variant), and how to represent that in the Relax NG schema.
  • Sort the layout entries by keycode value.

ANTLR grammar for XKB, and Relax NG schema (draft)

I completed the ANTLRv3 grammar for symbols/ configuration files of XKB. The grammar can parse and create the abstract syntax tree (AST) for all keyboard layouts in xkeyboard-config.

ANTLRv3 helps you create parsers for domain specific languages (DSL), an example of which is the configuration files in XKB.

Having the ANTLRv3 grammar for a configuration file allows to generate code in any of the supported target lagnuages (C, C++, Java, Python, C#, etc), so that you easily include a parser that reads those files. Essentially you avoid using custom parsers which can be difficult to maintain, or parsers that were generated with flex/bison.

On a similar note, here is the grammar to parse Compose files (such as en_US.UTF-8/Compose.pre). I am not going to be using in the project for now, but it was fun writing it. The Python target takes 18s to create the AST for the >5500 lines of the en_US.UTF-8 compose file, on a typical modern laptop.

I am also working on creating a RelaxNG schema for the XKB configuration files (those under symbols/). There is a draft available, which needs much more work.The Relax NG book by Eric van de Vlist is very useful here.

The immediate goal is to use the code generated by ANTLR to parse the XKB files and create XML files based on the Relax NG schema. I am using Python, and there are a few options; the libxml2 bindings for Python, and PyXML. The latter has more visible documentation, but I think that I should better be using the former.

Update: lxml appears to be the nice way to use libxml2 (instead of using directly libxml2).

Looking into the symbol files

In the previous post, we talked about the ANTLR grammar that parses the XKB layout files.

The grammar is available at http://code.google.com/p/keyboardlayouteditor/source/browse. I’ll rather push to the freedesktop repository once the project is completed. Now it’s too easy for me, just doing svn commit -m something.

Below you can see the relevant layout files for each country (and in some cases, language), and how the grammar deals with them. First column is filenames from the CVS XKB symbols subdirectory (to be moved eminently to GIT). Last’s week discussion with Sergey helped me figure out issues with the symbol files, simplify what information is needed, and what can be eliminated. Second column has Not OK if something is wrong. Third column tries to explain what was wrong.

ad
af
al
altwin
am
ara
az
ba
bd
be
bg
br
braille
bt
by
ca
capslock
cd
ch
cn
compose
ctrl
cz
de
dk
ee
epo
es
et
eurosign
fi
fo
fr
gb NOK Non-UTF8
ge
gh
gn
gr
group NOK virtualMods= AltGr
hr
hu NOK Non-UTF8
ie
il NOK key.type=”FOUR_LEVEL” (typically: key.type[something]=….)
in NOK key.type=”FOUR_LEVEL” (typically: key.type[something]=….)
inet
iq
ir
is
it
jp NOK key <BKSP> {
type=””,   // empty?
symbols[Group1]= [ bracketright, braceright ]
};
keypad NOK overlay1=<KO7> }; // what’s “overlay”?
kg
kh
kpdl
kr
kz
la
latam
latin
level3 NOK virtual_modifiers LAlt, AlGr; virtualMods= Lalt
level5
lk
lt
lv
ma
mao
me
mk
mm
mn
mt
mv
nbsp NOK Non-UTF8
ng
nl
no
np
olpc
pc NOK key <AA00> { type=”SOMETHING” } instead of { type[Group1]=”SOMETHING” }
pk
pl
pt
ro
rs
ru
se
shift NOK actions [Group1] = [
si
sk
srvr_ctrl NOK key <AA00> { type=”SOMETHING” } instead of { type[Group1]=”SOMETHING” }
sy
th
tj
tr
ua

Non-UTF-8 are the files that have characters that are not UTF-8 (are iso-8859-1).

Some layouts have key.type = “something” and others key.type[SomeGroup] = “something”. Apparently, the format allows to infer which is the group that the type acts upon? That’s weird. Would it be better to put the group information? Is it required that the group is not set?

Some files have virtualMods, which I do not know what it is. Is it used?

Parsing XKB files with antlr

antlr (well, antlr3) is an amazing tool that replaces lex/flex, yacc/bison.

One would use antlr3 if they want to deal with Domain-Specific Languages (DSL), an example of which are the text configuration files.

In our case, we use antlr3 to parse some of the XKB configuration files, those found in /etc/X11/xkb/symbols/??.

Our aim is to be able to easily read and write those configuration files. Of course, once we have them read, we do all sorts of processing.

The stable version of antlr3 is 3.0.1, which happened to give lots of internal errors. It has not been very useful, so I tried a few times the latest beta version 3.1b, and eventually managed to get it to work. If I am not mistaken, 3.1 stable should be announced in a few days.

When using antlr, you have the choice of several target languages, such as Java, C, C++ and Python. I am using the Python target, and the latest version that is available from the antlr3 repository.

Here is the tree of the gb layout file,

tree = (SECTION (MAPTYPE (MAPOPTIONS partial default alphanumeric_keys xkb_symbols) (MAPNAME “basic”)) (MAPMATERIAL (TOKEN_INCLUDE “latin”) (TOKEN_NAME Group1 (VALUE “United Kingdom”)) (TOKEN_KEY (KEYCODEX AE02) (KEYSYMS 2 quotedbl twosuperior oneeighth)) (TOKEN_KEY (KEYCODEX AE03) (KEYSYMS 3 sterling threesuperior sterling)) (TOKEN_KEY (KEYCODEX AE04) (KEYSYMS 4 dollar EuroSign onequarter)) (TOKEN_KEY (KEYCODEX AC11) (KEYSYMS apostrophe at dead_circumflex dead_caron)) (TOKEN_KEY (KEYCODEX TLDE) (KEYSYMS grave notsign bar bar)) (TOKEN_KEY (KEYCODEX BKSL) (KEYSYMS numbersign asciitilde dead_grave dead_breve)) (TOKEN_KEY (KEYCODEX LSGT) (KEYSYMS backslash bar bar brokenbar)) (TOKEN_INCLUDE “level3(ralt_switch_multikey)”))) (SECTION (MAPTYPE (MAPOPTIONS partial alphanumeric_keys xkb_symbols) (MAPNAME “intl”)) (MAPMATERIAL (TOKEN_INCLUDE “latin”) (TOKEN_NAME Group1 (VALUE “United Kingdom – International (with dead keys)”)) (TOKEN_KEY (KEYCODEX AE02) (KEYSYMS 2 dead_diaeresis twosuperior onehalf)) (TOKEN_KEY (KEYCODEX AE03) (KEYSYMS 3 sterling threesuperior onethird)) (TOKEN_KEY (KEYCODEX AE04) (KEYSYMS 4 dollar EuroSign onequarter)) (TOKEN_KEY (KEYCODEX AE06) (KEYSYMS 6 dead_circumflex NoSymbol onesixth)) (TOKEN_KEY (KEYCODEX AC11) (KEYSYMS dead_acute at apostrophe bar)) (TOKEN_KEY (KEYCODEX TLDE) (KEYSYMS dead_grave notsign bar bar)) (TOKEN_KEY (KEYCODEX BKSL) (KEYSYMS numbersign dead_tilde bar bar)) (TOKEN_KEY (KEYCODEX LSGT) (KEYSYMS backslash bar bar bar)) (TOKEN_INCLUDE “level3(ralt_switch)”))) (SECTION (MAPTYPE (MAPOPTIONS partial alphanumeric_keys xkb_symbols) (MAPNAME “dvorak”)) (MAPMATERIAL (TOKEN_INCLUDE “us(dvorak)”) (TOKEN_NAME Group1 (VALUE “United Kingdom – Dvorak”)) (TOKEN_KEY (KEYCODEX BKSL) (KEYSYMS numbersign asciitilde)) (TOKEN_KEY (KEYCODEX AE02) (KEYSYMS 2 quotedbl twosuperior NoSymbol)) (TOKEN_KEY (KEYCODEX AE03) (KEYSYMS 3 sterling threesuperior NoSymbol)) (TOKEN_KEY (KEYCODEX AE04) (KEYSYMS 4 dollar EuroSign NoSymbol)) (TOKEN_KEY (KEYCODEX LSGT) (KEYSYMS backslash bar)) (TOKEN_KEY (KEYCODEX AD01) (KEYSYMS apostrophe at)))) (SECTION (MAPTYPE (MAPOPTIONS partial alphanumeric_keys xkb_symbols) (MAPNAME “mac”)) (MAPMATERIAL (TOKEN_INCLUDE “latin”) (TOKEN_NAME Group1 (VALUE “United Kingdom – Macintosh”)) (TOKEN_KEY (KEYCODEX AE02) (KEYSYMS 2 at EuroSign)) (TOKEN_KEY (KEYCODEX AE03) (KEYSYMS 3 sterling numbersign)) (TOKEN_INCLUDE “level3(ralt_switch)”)))

When traversing the tree, we can then pretty-print the layout at wish:

partial default alphanumeric_keys xkb_symbols “basic” {
name[Group1] = “United Kingdom”;
include “latin”
include “level3(ralt_switch_multikey)”
key <AE02> = { [ 2 , quotedbl , twosuperior , oneeighth ] };
key <AE03> = { [ 3 , sterling , threesuperior , sterling ] };
key <AE04> = { [ 4 , dollar , EuroSign , onequarter ] };
key <AC11> = { [ apostrophe , at , dead_circumflex , dead_caron ] };
key <TLDE> = { [ grave , notsign , bar , bar ] };
key <BKSL> = { [ numbersign , asciitilde , dead_grave , dead_breve ] };
key <LSGT> = { [ backslash , bar , bar , brokenbar ] };
};
… snip …

The code is currently hosted at code.google.com (keyboardlayouteditor) and I intend to move it shortly to FDO.

Προβληματικές συμπεριφορές στο adslgr.com/Forum του Linux

Παρακολουθώ μερικά forum και την ενότητα για Linux που έχουν, και αρκετές φορές απαντώ σε ερωτήματα χρηστών. Μερικά έχουν μικρή κίνηση, άλλα έχουν αρκετή και είναι πολύ ζωντανά. Ένα από τα forum αυτά είναι το ADSLGR.com @ Linux.

Ωστόσο υπάρχει ένα πρόβλημα συμπεριφοράς από μερικά από τα «παλιά» μέλη που χρησιμοποιούν τακτικές bullying για να περάσουν τις απόψεις τους. Είναι πραγματικά παράξενο να έχουμε τέτοια ζητήματα στο ελεύθερο λογισμικό. Ωστόσο έτσι φαίνεται να είναι.

Σε μια συζήτηση, για τα νεότερα στο GNOME 2.22,
http://www.adslgr.com/forum/showthread.php?t=184570 υπήρξαν σχόλια με ύψηλο flameability,

Α. «Ακομα πιο προηγμενο, τωρα ΚΑΙ με υποστηριξη για webcam. »
http://www.adslgr.com/forum/showpost…31&postcount=2

Β. «χαχαχα, μπήκε download notification στον epiphany.»
http://www.adslgr.com/forum/showpost…86&postcount=6

Γ. «Σε λίγο θα διαφημίσουν και το κουμπάκι “πίσω”, ε μα είναι πράγματα αυτα?»
http://www.adslgr.com/forum/showpost…13&postcount=9

Δ. « Αρχικό μήνυμα από simosx Διαβάζω όλα αυτά τα ειρωνικά σχόλια, όπως και στο άλλο thread με τον έξυπνο τίτλο gnome-vs-kde.
Ως ελληνική κοινότητα φαίνεται να είμαστε άσχετοι από τα τεκτενόμενα στο εξωτερικό. Είμαστε θεατές με επιφανειακή γνώση. »

««Συγγνώμη, για να εκφέρουμε άποψη πρέπει να συνεισφέρουμε πρώτα? Έλεος, διαφημίζουν τα αυτονόητα που υπάρχουν σε άλλους browsers εδώ και 10 χρόνια και καμαρώνουν κιόλας…?
Εντάξει, αφου πλέον μπορώ να βλεπω την ώρα στην Αυστραλία για να μην παρεξηγούμαι που δεν απαντάει στο msn η τουρ-τουρίστρια που γνώρισα πέρσυ, όλα καλά .»»
http://www.adslgr.com/forum/showpost…9&postcount=11

Ε. «Θα σου δώσει κατάλληλη απάντηση κάποιος καλοθελητής σε λίγο.»
http://www.adslgr.com/forum/showpost…3&postcount=13

ΣΤ. «Χρησιμοποιώ και gnome ενίοτε αλλά με τέτοιες μπαρούφες που κάθονται και του βάζουν…»
http://www.adslgr.com/forum/showpost…7&postcount=31

Ζ. «το μόνο σίγουρο είναι πως κάναμε hijacked το θέμα του gnome
έτσι κι αλλιώς δεν έχει ενδιαφέρον »
http://www.adslgr.com/forum/showpost…5&postcount=47

Η. « Αρχικό μήνυμα από no_logo το μόνο σίγουρο είναι πως κάναμε hijacked το θέμα του gnome
έτσι κι αλλιώς δεν έχει ενδιαφέρον
Ποιος το λέει ; Ο καθοδηγητής μήπως ; »
http://www.adslgr.com/forum/showpost…9&postcount=50

Θ. « Αρχικό μήνυμα από midnightsun Ποιος το λέει ; Ο καθοδηγητής μήπως ;
η πραγματικότητα 1 σελίδα είναι η “είδηση” για το gnome, οι υπόλοιπες είναι bashing από kde χρήστες και το πρόβλημα του ATC
Πάρε μάτι το νήμα του kde 4 που ενώ δεν έχει βγει ακόμα μαζικά έχουν γραφτεί σελίδες επι σελίδων
Αυτή είναι η διαφορά, ψοφοδεής κοινότητα από την μια vs την ζωντανή και ενεργητική κοινότητα του kde »
http://www.adslgr.com/forum/showpost…8&postcount=51

(σταματώ στη σελίδα 5 του νήματος· πάει μέχρι το 8)

Αυτό που βλέπω είναι ότι η αρνητική συμπεριφορά δεν είναι μεμονωμένη, και υπάρχουν και moderators που λαμβάνουν μέρος.

Αν μια διανομή είναι καλύτερη ή όχι από μια άλλη, αυτό δεν μπορεί να είναι αίτια για τέτοιες αρνητικές συμπεριφορές. Στην πραγματικότητα, οι διανομές/γραφικά περιβάλλοντα αποτελούν απλά αφορμή, κάτι το επιφανειακό.

Ένα άλλο χαρακτηριστικό είναι η κομπλεξική συμπεριφορά και η χρήση γραφικών εκφράσεων όπως «μυκητίαση» ή «μούχλα» (σε κάποια βίντεο κατά την αναπαραγωγή φαίνονται κάποιες περιοχές σε πράσινο χρώμα· πρώτη φορά το ακούω, και η λύση ίσως να είναι ένα απλό «περίμενε να ολοκληρωθεί το torrent»). Ο τίτλος της συζήτησης ήταν «18 μήνες έχει κλείσει αδιόρθωτο το bug της μούχλας του Xine».

Άλλες εκφράσεις συμπεριλαμβάνουν «άθλιο», που είναι μια γενική περιγραφή για τα προγράμματα που δεν καταλαβαίνουμε πως δουλεύουν.

Ένα ακόμα μήνυμα που βλέπουμε να περνάει από το adslgr.com/Linux είναι ότι στο ελεύθερο λογισμικό υπάρχουν κάποιοι «άλλοι» που έχουν υποχρέωση να κάνουν τη δουλειά, και αν δεν την κάνουν σωστά είναι άθλιοι. Αυτοί οι άλλοι είναι ταπεινοί υπηρέτες μας. Εδώ πρέπει να υπάρχει μια υποβόσκουσα σύνδεση στη σειρά Lost και τους Άλλους. (Ωχ, και εγώ κατάντησα να λέω μακίες).

Τι προβλήματα δημιουργεί αυτή η αρνητική συμπεριφορά;

  • Είναι ιδιαίτερα επιβλαβής στην ελληνική κοινότητα ελεύθερου λογισμικού. Η κοινότητα βασίζεται στην «ελεύθερη οργάνωση» που σημαίνει ότι δεν υπάρχουν επίσημες δομές στήριξης που θα περίμενε κάποιος σε ένα επιχειρηματικό περιβάλλον. Αν κάποιος νέος χρήστης τύχει να περάσει πρώτα από το ADSLGR.com για να μάθει για το Linux, τότε η κοινότητα έχει πιθανότατα χάσει ένα μέλος.
  • Τα μέλη διαιωνίζουν την αρνητική συμπεριφορά και σε άλλους χώρους.
  • Προκαλούν burnout (κούραση, μειωμένο ενδιαφέρον) στα άτομα που πραγματικά βοηθάνε. Μερικά από τα άτομα αυτά έχουν ήδη γίνει ban (!) διότι δεν ακολουθούν τη γραμμή των μπούληδων. Πάντως σε τελική ανάλυση κάτι τέτοιο είναι θετικό μιας και δεν ασχολούνται πια με το φόρουμ αυτό.

Για το που πάει το forum αυτό, ας δούμε μια πρόσφατη εγγραφή στο ίδιο φόρουμ κάποιου χρήστη, για τη διανομή Ubuntu (emphasis mine).

Θέμα: Ubuntu 8.04: Κάθε πέρυσι και καλύτερα?

Θα ήθελα τη γνώμη των χρηστών που εγκατέστησαν – δοκίμασαν την πιο πρόσφατη έκδοση της Ubuntu. Θα ήθελα να ξέρω αν, παρά τις διθυραμβικές κριτικές που είχα διαβάσει πριν την έλευσή της σε διάφορα τεχνολογικά sites, έχετε την ίδια αίσθηση με μένα: ΑΠΟΓΟΗΤΕΥΣΗ!
Κατ’ αρχάς να πω ότι το τελευταίο εξάμηνο χρησιμοποιούσα αρχικά την Feisty και ακολούθως την Gutsy. Συγκρίνοντας τις δύο μεταξύ τους θεωρούσα ότι υπήρχε μία αργή αλλά σταθερή βελτίωση στις διανομές. Στο laptop και οι δύο λειτουργούσαν θαυμάσια (ένα Sony Vaio) αλλά στο deskotp η Feisty αρνιόταν να αναγνωρίσει μία ασύρματη κάρτα Linksys WMP54g 4.1. Το πρόβλημα λύθηκε (σχεδόν) με την έλευση της Gutsy οπότε και με μερικά τρικ κατάφερα να εγκαταστήσω επιτυχώς Ubuntu και στο desktop. Το upgrade δε από Feisty σε Gutsy ήταν απλά άψογο.
Για να έρθουμε στην τελευταία έκδοση, Hardy Heron. Κατ’ αρχάς το upgrade και στα δύο μηχανήματα δημιούργησε προβλήματα και αναγκάστηκα να κάνω clean install κρατώντας σταθερό το home. Στο laptop είχα πρόβλημα στην εναλλαγή των layouts στο πληκτρολόγιο, καθώς έπρεπε να το ορίσω σε κάθε boot για να δουλέψει. Επίσης πρόβλημα παρουσιάστηκε στην ομαλή λειτουργία του openoffice (περίεργα κωλύματα που δεν είχα ξανασυναντήσει στην προηγούμενη έκδοση) και στη λειτουργία του emerald theme manager. Στο desktop δεν είχα το πρόβλημα με τα layouts του πληκτρολογίου αλλά είχα τα ίδια με το openoffice και το emerald, ενώ η σταγόνα που ξεχείλισε το ποτήρι ήταν ότι δε δούλευε το number keypad του πληκτρολογίου που δούλευε μία χαρά στην προηγούμενη έκδοση.
Για να μη σας κουράσω, έχω πλέον ξαναγυρίσει στην gutsy και στα δύο μου μηχανήματα. Το ερώτημα: είχατε αντίστοιχα προβλήματα? Και η αγωνία: θα είναι η 8.10 καλύτερη ή χειρότερη (η 8.04 είναι και LTS τρομάρα τους!)
To ADSLGR.com ως δικτυακός τόπος είναι σημαντικός και προσφέρει αρκετά στη γενικότερη κοινότητα. Το θέμα είναι ότι το κομμάτι που έχει να κάνει με το Linux είναι προβληματικό, και κάποιοι από τους συντονιστές διαιωνίζουν αντί να διορθώνουν την κατάσταση.
Αυτό που θα ήθελα να προτείνω στους χρήστες είναι να αποφεύγουν το ADSLGR.com/Linux για το άμεσο μέλλον, μέχρι τουλάχιστον να αλλάξει η κατάσταση.
Ενημέρωση: Όχι άλλα σχόλια πια. Μπορείτε να συνεχίσετε τα σχόλιά σας στο http://adslgr-critics.blogspot.com/.

Keyboard Layout Editor GSOC project

I got accepted for a GSOC project with the X.Org Foundation. My mentor is Sergey Udaltsov and I look forward working with him.

The project is about creating a Keyboard Layout Editor, that can be used to edit XKB files with a nice GUI.

I will be blogging about these from here (fdo category at this blog).

Testing the updated IM support in GTK+

In Improving input method support in GTK+-based apps, we talked about some work to update the list of compose sequences that GTK+ knows to the latest version that comes from Xorg. From 691 compose sequences, we now support over 5000.

The patch has landed in GTK+ (trunk), and here are instructions for testing.

  1. If you have not used jhbuild before, read the jhbuild instructions and install it.
  2. Add the following to your ~/.jhbuildrc file
    branches['gtk+'] = None    # Makes sure you build from the trunk of GTK+
  3. Install gtk+ using the command (see the comment of James on this post on how to avoid Step 5 below)
    jhbuild build gtk+
  4. About 40 minutes later, and about 700MB of space (~600MB for source, ~100MB for installation of files) consumed, you should get a working copy of GTK+ 2.12.
  5. You can use this compiled version of GTK+ by running
    jhbuild shell

    This should give you a new shell, and whatever you run from here will use our fresh GTK+. Try running “gedit”. You will notice that the theme is different; it uses the default theme due to the special GTK+. This shell has set special environment variables so that program that run will use the fresh GTK+. The rest of the libraries come from our distribution.

  6. If you try to type compose sequences, you will notice no improvement. This is because at the moment jhbuild builds the branch 2.12 of GTK+ and not trunk. We need to download GTK+ from trunk and rebuild.
    cd ~/checkout/gnome2/
    mv gtk+ gtk+-branch-2.12
    svn co svn://svn.gnome.org/svn/gtk+/trunk gtk+
    jhbuild build --no-network gtk+
  7. Perform Step 4 and get gedit running.

How to test?

  • Setup a keyboard layout that supports a good variety of dead keys. My preference is GBr (United Kingdom). Here, AltGr+[];’#/ and AltGr+{}:@~? produce different dead keys. You press one of these combinations and then you press a letter. If such a combination exists, then it gets printed. For example, the old GTK+ produces öõóôòx åōőxxx. The new GTK+ produces öõóôòọ åōőǒŏȯ (12 dead keys).
  • Setup Greek, Polytonic (Ancient Greek). The dead keys are [];’ {}:@ AltGr+[] (10 dead keys). Produce characters such as ᾅᾂᾷῗὕὒᾥᾢῷ.
  • Try compose sequences as described from the upstream file at XOrg. For example,
    ComposeKey+(   1 0 )  produces ⑩. Try the same for 0-20, a-zA-Z.
  • Other miscellaneous, Ṩǟấẫǡ (using GBr layout)

The next step would be to parse the list of compose sequences and produce a documentation file.