22. Juni 2011

Typing unicode

Category: Howto / Tutorial — Tags: – Kay Smarczewski @ 00:00

During the last years at university, I had to write countless texts including special characters like greek letters. Thanks to UTF-8 encoding, all the problems with these signs are gone. The can proper input and display them. But I did not get to type them directly via keyboard for a long time. Writing my diploma thesis these days, I managed to modify my keymap.

And that is almost all the magic: you have to modify your keymap to map the keys on your keyboard to a special char. My standard keyboard layout is German quertz. The OS is Linux with running Xorg.

I want to use my Menu key as a modifier key to access the greek charcters. First, I need the keycode of this key. xev get it for you. Just start the program, type the relevant key and look for the output of the keycode. In my case, it is 135.

Then you can start to modify your keymap. This can be done by a ~/.xmodmaprc file. The UTF-8 and Unicode FAQ for Unix/Linux gives a nice overview about the following tasks.
keycode 135 = Mode_switch Mode_switch
selects my Menu key as a modifier key. After that you can add the mapping stuff. One line as the following structure:

  1. keysym =
  2. the lower key symbol (propably the same as you wrote before the “=”)
  3. the upper key symbol (Shift + key)
  4. the lower modified key symbol (Menu key + key)
  5. the upper modified key symbol (Shift + Menu key + key)
  6. the lower AltGr modified key symbol (AltGr + key)
  7. the upper AltGr modified key symbol (Shirt + AltGr + key)

You can use an alias to a key symbol or the unicode identifier with “Uxxxx”.
Look at my .xmodmaprc for an example. Be sure not to forget especially the lower and upper key symbol. Otherwise, you cannot use these keys any more during your X session (e.g. to edit your .xmodmaprc ;) )

When the work is finished and saved,
xmodmap .xmodmaprc
activates your new keymap. If something goes wrong you can return to the defaults by restarting your X server. If everythin works well, you can add the line above e.g. to your .xsession file to load the changes automatically when starting X.

Note: Follow the instructions at your own risk! See my Impressum!

Keine Kommentare »

Noch keine Kommentare

RSS Feed für Kommentare zu diesem Artikel. | TrackBack URI

Hinterlasse einen Kommentar

XHTML ( You can use these tags):
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .

Kay Smarczewski


mein Blog

Seiten

Kalender mit Posts

Juni 2011
M D M D F S S
« Dez    
 12345
6789101112
13141516171819
20212223242526
27282930  

Schlagwörter

Dieses Blog durchsuchen

© Kay Smarczewski – Powered by WordPress