vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Aragorn wrote: > Hi guys, > > Sorry to bother you again with my confusion, but I'm trying to implement > systemwide locales settings, and it would seem there's a difference in the > available locales between Gentoo and my old Mandrake... I seem to have run into another little mystery here for which neither the documentation nor Google provide any useful help... In the file */etc/conf.d/keymaps,* there is a variable /EXTENDED_KEYMAPS./ By default it is set to "", but an alternative value underneath which is commented out lists "backspace keypad euro" as example values. Can anyone tell me what those values mean, or at least what "backspace" and "keypad" mean there? (I suppose I know what "euro" means.) -- Aragorn (registered GNU/Linux user #223157) |
| |||
| Aragorn wrote: > I seem to have run into another little mystery here for which neither the > documentation nor Google provide any useful help... > > In the file */etc/conf.d/keymaps,* there is a variable /EXTENDED_KEYMAPS./ > By default it is set to "", but an alternative value underneath which is > commented out lists "backspace keypad euro" as example values. > > Can anyone tell me what those values mean, or at least what "backspace" > and "keypad" mean there? (I suppose I know what "euro" means.) Whatever you put into EXTENDED_KEYMAPS is passed as an argument to loadkeys. This is the relevant line from the /etc/init.d/keymaps script (which loads the keymaps for the console only, not for X window): ebegin "Loading key mappings" if [[ -x /bin/loadkeys ]] ; then [[ ${SET_WINDOWKEYS} == "yes" ]] && WINDOWKEYS_KEYMAP="windowkeys" /bin/loadkeys -q ${WINDOWKEYS_KEYMAP} ${KEYMAP} \ ${EXTENDED_KEYMAPS} > /dev/null eend $? "Error loading key mappings" else eend 1 "/bin/loadkeys not found" return 1 fi Essentially, the arguments to loadkeys are filenames of console map files, generally found under /usr/share/keymaps/<arch> (where <arch>, for normal PCs - either x86 or amd64 - is "i386"). So, as an example, using this configuration: KEYMAP="be-latin1" EXTENDED_KEYMAPS="euro backspace keypad" will result in the following command being executed by the initscript: /bin/loadkeys -q be-latin1 euro backspace keypad which will load the following keymap files: /usr/share/keymaps/i386/azerty/be-latin1.map.gz /usr/share/keymaps/i386/include/euro.map.gz /usr/share/keymaps/i386/include/backspace.map.gz /usr/share/keymaps/i386/include/keypad.map.gz (You can do ls /usr/share/keymaps/i386/{azerty,dvorak,fgGIod,include,qwerty,qwertz} and see for yourself what keymaps are available) The keymaps located in include/ are not full keymaps; they just define some extra keys, like, for instance, the euro key or the backspace key, which complement the main keymap. And yes, they are plain text files, so you can see what they do (if not already apparent by their name). For example, this is /usr/share/keymaps/i386/include/euro.map.gz: $ zcat /usr/share/keymaps/i386/include/euro.map.gz # Euro and cent # [Say: "loadkeys euro" to get Euro and cent with Alt on the positions # where many keyboards have E and C. # To get it displayed, use a latin0 (i.e., latin9) font.] alt keycode 18 = currency alt keycode 46 = cent So, using EXTRA_KEYMAPS="euro" will give you the "€" and "¢" symbols in console, provided you use a font that can render them. In my experience, using "backspace" in EXTRA_KEYMAPS is useless, since most keymaps already define that key themselves. Hope this helps. |
| |||
| pk wrote: > Aragorn wrote: > >> I seem to have run into another little mystery here for which neither the >> documentation nor Google provide any useful help... >> >> In the file */etc/conf.d/keymaps,* there is a variable >> /EXTENDED_KEYMAPS./ By default it is set to "", but an alternative value >> underneath which is commented out lists "backspace keypad euro" as >> example values. >> >> Can anyone tell me what those values mean, or at least what "backspace" >> and "keypad" mean there? (I suppose I know what "euro" means.) > > [...] > So, as an example, using this configuration: > > KEYMAP="be-latin1" > EXTENDED_KEYMAPS="euro backspace keypad" > > will result in the following command being executed by the initscript: > > /bin/loadkeys -q be-latin1 euro backspace keypad > > which will load the following keymap files: > > /usr/share/keymaps/i386/azerty/be-latin1.map.gz > /usr/share/keymaps/i386/include/euro.map.gz > /usr/share/keymaps/i386/include/backspace.map.gz > /usr/share/keymaps/i386/include/keypad.map.gz > > (You can do > > ls /usr/share/keymaps/i386/{azerty,dvorak,fgGIod,include,qwerty,qwertz} > > and see for yourself what keymaps are available) > > The keymaps located in include/ are not full keymaps; they just define > some extra keys, like, for instance, the euro key or the backspace key, > which complement the main keymap. And yes, they are plain text files, so > you can see what they do (if not already apparent by their name). For > example, this is /usr/share/keymaps/i386/include/euro.map.gz: > > $ zcat /usr/share/keymaps/i386/include/euro.map.gz > # Euro and cent > # [Say: "loadkeys euro" to get Euro and cent with Alt on the positions > # where many keyboards have E and C. > # To get it displayed, use a latin0 (i.e., latin9) font.] > alt keycode 18 = currency > alt keycode 46 = cent I suppose that UTF-8 will cover those too? > So, using EXTRA_KEYMAPS="euro" will give you the "€" and "¢" symbols in > console, provided you use a font that can render them. > > In my experience, using "backspace" in EXTRA_KEYMAPS is useless, since > most keymaps already define that key themselves. This was what confused me, as most keyboards for what is generally considered "the PC architecture" nowadays are of the "extended" type, and I've never seen a keyboard, extended or otherwise, that didn't have a backspace key. > Hope this helps. Absolutely! My gratitude to you, Sir! ;-) -- Aragorn (registered GNU/Linux user #223157) |
| ||||
| Aragorn wrote: >> $ zcat /usr/share/keymaps/i386/include/euro.map.gz >> # Euro and cent >> # [Say: "loadkeys euro" to get Euro and cent with Alt on the positions >> # where many keyboards have E and C. >> # To get it displayed, use a latin0 (i.e., latin9) font.] >> alt keycode 18 = currency >> alt keycode 46 = cent > > I suppose that UTF-8 will cover those too? AFAIK, UTF-8 is only part of the story. UTF-8 cannot know which symbol to associate to which keybord scancode (of course), and this is what keymap files do. So you need both UTF-8 (to support multibyte characters) /and/ an appropriate keymap for your keyboard. Again, keymaps are for console only, not X window. >> In my experience, using "backspace" in EXTRA_KEYMAPS is useless, since >> most keymaps already define that key themselves. > > This was what confused me, as most keyboards for what is generally > considered "the PC architecture" nowadays are of the "extended" type, and > I've never seen a keyboard, extended or otherwise, that didn't have a > backspace key. I didn't mean that. IIRC, the problem in the past was that, while the backspace key was indeed present in many keyboard, by default it had an incorrect mapping (eg it was mapped to DEL). The additional "backspace" keymap was meant to map the backspace key (keycode 14) to ^H: $ zcat /usr/share/keymaps/i386/include/backspace.map.gz keycode 14 = Control_h Control_h alt keycode 14 = Meta_Control_h If you want a bit of historical background on the backspace/delete madness under linux, read the "Linux backspace/delete mini-HOWTO". However, I have noticed that nowadays, while many popular keymaps insist on defining keycode 14 as "Delete", the backspace and delete keys work correctly nonetheless, without the need to load the "backspace" additional keymap (I did not dig deeper to find out why, however; I'm just satisfied with the way it works, and I don't use the console a lot anyway). |