Jump to content

Compose symbols with the keyboard


Guest fiomba
 Share

Recommended Posts

I am a new member of this forum and also almost new of Linux.

I hope to receive some help from experts... (in other forums...no significant answers till now!).

 

This thread is specific for Mandrake distro (but perhaps can be used by other Linux's flavours).

 

I wanted to insert new symbols with "compose" key combinations on my keyboard...

I began my investigation studying the boot process by examinating the logs

 /var/logs/messages

 

After isolating the messages relating to the last boot (you have about 20 Mb of messages...), I searched for the keyword "keymap", and I found that us.kmap.gz is loaded two times from

/usr/lib/kbd/keymaps/i386/qwerty/us.kmap.gz

(I have a USA keyboard without Win keys).

 

Together with us.kmap (see below)

# us.kmap
keymaps 0-2,4-6,8-9,12
alt_is_meta
include "qwerty-layout"
include "linux-with-alt-and-altgr"
strings as usual

keycode   1 = Escape
keycode   2 = one              exclam
keycode   3 = two              at               at               nul              nul
keycode   4 = three            numbersign
control keycode   4 = Escape
keycode   5 = four             dollar           dollar           Control_backslash
keycode   6 = five             percent
control keycode   6 = Control_bracketright
keycode   7 = six              asciicircum
control keycode   7 = Control_asciicircum
keycode   8 = seven            ampersand        braceleft        Control_underscore
keycode   9 = eight            asterisk         bracketleft      Delete
keycode  10 = nine             parenleft        bracketright
keycode  11 = zero             parenright       braceright
keycode  12 = minus            underscore       backslash        Control_underscore Control_underscore
keycode  13 = equal            plus
keycode  14 = Delete
keycode  15 = Tab
keycode  26 = bracketleft      braceleft
control keycode  26 = Escape
keycode  27 = bracketright     braceright       asciitilde       Control_bracketright
keycode  28 = Return
alt keycode  28 = Meta_Control_m
keycode  29 = Control
keycode  39 = semicolon        colon
keycode  40 = apostrophe       quotedbl
control keycode  40 = Control_g
keycode  41 = grave            asciitilde
control keycode  41 = nul
keycode  42 = Shift
keycode  43 = backslash        bar
control keycode  43 = Control_backslash
keycode  51 = comma            less
keycode  52 = period           greater
keycode  53 = slash            question
control keycode  53 = Delete
keycode  54 = Shift
keycode  56 = Alt
keycode  57 = space
control keycode  57 = nul
keycode  58 = Caps_Lock
keycode  86 = less             greater          bar
keycode  97 = Control

 

the boot process loads also:

/usr/lib/kbd/keymaps/include/compose.latin.inc.gz

 

The us.kmap seems merely a scancode list, but why load it twice?

 

More interesting is the associated "compose.latin.inc.gz", which is too big to list.

Only some lines...:

#
# Default compose file
#
# Those compose lines can be shared between latin1, 2 and 3. They give good
# results.
compose '!' '!' to '¡'
compose '"' 'A' to 'Ä'
compose '"' 'E' to 'Ë'
compose '"' 'I' to 'Ï'
compose '"' 'O' to 'Ö'
compose '"' 'U' to 'Ü'

By means of:

hexdump -Cv compose.latin.inc

which output is:

00000000  23 0a 23 20 44 65 66 61  75 6c 74 20 63 6f 6d 70  |#.# Default comp|
00000010  6f 73 65 20 66 69 6c 65  0a 23 0a 23 20 54 68 6f  |ose file.#.# Tho|
00000020  73 65 20 63 6f 6d 70 6f  73 65 20 6c 69 6e 65 73  |se compose lines|
00000030  20 63 61 6e 20 62 65 20  73 68 61 72 65 64 20 62  | can be shared b|
00000040  65 74 77 65 65 6e 20 6c  61 74 69 6e 31 2c 20 32  |etween latin1, 2|
00000050  20 61 6e 64 20 33 2e 20  54 68 65 79 20 67 69 76  | and 3. They giv|
00000060  65 20 67 6f 6f 64 0a 23  20 72 65 73 75 6c 74 73  |e good.# results|
00000070  2e 0a 63 6f 6d 70 6f 73  65 20 27 21 27 20 27 21  |..compose '!' '!|
00000080  27 20 74 6f 20 27 a1 27  0a 63 6f 6d 70 6f 73 65  |' to '¡'.compose|
00000090  20 27 22 27 20 27 41 27  20 74 6f 20 27 c4 27 0a  | '"' 'A' to 'Ä'.|
000000a0  63 6f 6d 70 6f 73 65 20  27 22 27 20 27 45 27 20  |compose '"' 'E' |
000000b0  74 6f 20 27 cb 27 0a 63  6f 6d 70 6f 73 65 20 27  |to 'Ë'.compose '|
000000c0  22 27 20 27 49 27 20 74  6f 20 27 cf 27 0a 63 6f  |"' 'I' to 'Ï'.co|
000000d0  6d 70 6f 73 65 20 27 22  27 20 27 4f 27 20 74 6f  |mpose '"' 'O' to|
000000e0  20 27 d6 27 0a 63 6f 6d  70 6f 73 65 20 27 22 27  | 'Ö'.compose '"'|
000000f0  20 27 55 27 20 74 6f 20  27 dc 27 0a 63 6f 6d 70  | 'U' to 'Ü'.comp|

you can see that '¡' is hex 'a1' (that is only one byte: the acute accented 'i') and so on.

 

Make a comparison with the Extended ASCII Table (Code Page 850).

 

My question is (at last... you can say):

How can I use the Compose key combinations to obtain the listed characters (and the others)?

 

It seems that an extended mapping is already loaded, but it doesn't match:

 

For example:

normal characters: `1234567890-=   qwertyuiop[] asdfghjkl;' zxcvbnm,./
AltGr +     "      ¬¹²³¼½¾{[]}\    @łe¶ŧ←↓→øþ   æßðđŋħjĸł   «»¢“”nµ·
AltGr+Shift+char   ¬¡⅛£$⅜⅝⅞™±°¿ ΩŁE®Ŧ¥↑ıØÞ  Æ§ÐªŊĦJ&Ł   <>©`'Nº×÷

For AltGr I mean the Alt key on the right.

 

If I could replicate the key combinations of "compose.latin.inc.gz", I could choose the combinations that interest to me (writing a new "compose.latin.inc.gz")...

... or do you know from where come out the key combinations already present on the keyboard?

 

During my attempts to get useful key combinations, I realized that my keyboard was setted as USA and so I changed to International (from the Control Center of Mandrake).

 

From that point on, I lost the AltGr key combinations (you can see a few lines above) but I got the "dead" keys (also if I don´t want them!).

The keymap files that are loaded during boot are:

/usr/lib/kdb/keymaps/i386/qwerty/us-latin1.kmap.gz
/usr/lib/kdb/keymaps/include/compose.latin.inc.gz

 

To go back to previous situation, it is sufficient to reset the keyboard as USA.

So I did to get rid off the hateful "dead" keys...

For those who don't know what is the "dead" key technique, a brief explanation:

to use particular keys (ticks, tilde and so on) to obtain accented letters.

When you press a dead key nothing appears (it seems dead), only when you press the following key (generally a vowel) you see the effect of the dead key (in form of various forms of accent).

 

If you want to use the tick (for example to define a string) you must press twice the key (utterly inconceivable!).

 

A last note: the AltGr key combinations generate mostly Unicode symbols or something like that because Linux refuses to make a backup of the (long!) post on hard disk.

Link to comment
Share on other sites

I can see you're new to Linux but not new to computers :). However, a DE (desktop environment) like KDE recognizes most keyboards and keyboard layouts.

 

In the KDE Control Center-->Region & Accessability-->Keyboard layout you can make any kind of combination. (the same will go for Gnome) Further KDE uses khotkeys with wich you can bind 'actions' to the keys. (very helpfull when you have a multimdia keyboard with tons of buttons).

 

Last, the best place to ask questions about the use of keyboards under Linux are the XFree (or now Xorg) mailinglists. The handling of keyboards is a part of X.

 

Good luck.

Link to comment
Share on other sites

Thanks for your suggestions (you are one of the very few Linux experts who has given me meaningful suggestions).

 

But what you are suggesting (the path to reach the kde keyboard configuration items is somewhat different...) are not immediately useful. To a newbie like me they seems more "action" configuration (like Control C for Copy to the Clipboard).

 

Besides that I have in mind to act "before" KDE" (almost at kernel configuration level...).

 

I am almost sure (... but I am a newbie!) that there is some method to modify configuration files to make the keyboard act as I want.

Link to comment
Share on other sites

Disclaimer: I'm not an expert, just a 'heavy' user. :)

 

http://www.mail-archive.com/devel@xfree86.org/msg03359.html

 

This post tells how someone got some keys on his keyboard to function. With xmodmap -kp you can get all the keycodes for all the characters on your keyboard. Maybe you can combine the 2 and get what you want?

Link to comment
Share on other sites

If you are a 'heavy' user, I am a very "light " user...

 

I thank you for the html ref (I will read it). Unfortunately I am not able to transmit the importance of what I am trying to do, that is to obtain foreign symbols (accented letteers, euro symbol and so on) without using the "dead" keys technique...

Probably for English or American people, that is not very important...

Link to comment
Share on other sites

One way to set up your system to allow typing of accented characters is to select one of the language specific keyboards using Mandrake Control Center->Hardware->Keyboard. If you want a general purpose keyboard select "US keyboard (international)". When set to that layout, for example, if you type ' followed by e you will get é. In those instances where you want to type that sequence but do not want an accented character, you have to type a space after the accent before typing the accent-able character. Most common accented characters seem to be available, but I haven't explored this facility fully so I can't tell if this will work for you.

Link to comment
Share on other sites

thanks of your observations, but I think that you have not read my 1st post till the end...

 

What you are suggesting is indeed the "dead" key technique, that I don't love too much...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...