| Products | Download |
|||||||||
![]() ![]() ![]() ![]()
|
Appendix AKeyboard Mapping File Format The Keyboard Mapping file has two sections, [KEYS] and [COMPOSERS_XKK], each consisting of keysym statements and possible comments. Text entered after a ';' sign is ignored and will be treated as a comment. A keysym specification uses a set of standard X numbers to describe a symbol. For example, a lowercase 'a' has a special number code. The KEYS Section In the [KEYS] section, each keysym statement associates a set of one to four keysyms with a physical key. Synopsis of a statement is: KEYnn = keysym1 [, keysym2 [, keysym3 [, keysym4]]] 'nn' is the identifying number of a PC's key. Every PC's key has an entry in the section. The entry name is the text KEY followed by the decimal ScanCode number (key_number) and followed by the letter 'E' if the key has the extended flag set. keysym1 is the keysym associated with the key in a non-shifted state (Normal). This is the only parameter that must be entered. keysym2 is the keysym associated with the key when the key is Shifted. keysym3 is the keysym associated with the key when a Mode-Shift key is pressed (Alt-Gr). keysym4 is the keysym associated with the Shift + Mode-Shift sequence (Shift + Alt-Gr). A Mode-Shift is a physical key which has a keysym value of 0xFF7E, (predefined as the ModeSwitch symbol), and which is assigned to one of the modifiers MOD1 to MOD5. A full keysym specification consists of four numbers, each of which is in the range of 0 through 255 decimal (or 0x00 through 0xFF hex). The standard predefined X keysyms use only the third and fourth numbers. The first two numbers are assumed to be zero. nfsAxe accepts keysyms in the following three formats: 1) In the dotted notation, where up to four numeric components are separated by periods '.'. Each numeric component represents one of the four numbers that defines a keysym. If a component is omitted, it is assumed to be zero in the left-most position. If two components are omitted, the two left-most components are assumed to be zero, etc. For example, if you enter the numbers 32.255 two of the four possible components are omitted. The keysym will be interpreted as 0.0.32.255 In the dotted notation, the two lines below both represent the same keysym: 255.0xFE 2) A single numeric value containing up to four bytes specifications. Unspecified numbers are assumed to be zeroes in the left-most position. For example: 0xFF20 represents the values 0xFF and 0x20. The keysym is interpreted as follows: 0.0.0xFF.0x20 Predefined symbols can be used instead of the keysym formats described above. The following three symbols are predefined: ModeSwitch 0xFF7E You can get a full list of X-keys via the xmodmap utility of UNIX by using the -pm and/or -pk options. The values of keysyms for keys may be obtained via the /usr/openwin/demo/xev X-Window's UNIX utility. 3) A keysym value can be of a composer type, i.e. the COMPxx entry exists in the [COMPOSERS_XKK] section with the keysym value 'xx'. See the [COMPOSER_XKK] section below for details of how composers work. Examples:
[KEYS]
KEY30 = 97, 65 ; LATIN LETTER a / A
; KEY30 = 0x61, 0x41 ; (XK_a, XK_A);
just the same as the previous line
KEY80E= 255.84, 255.84 ; cursor DOWN / cursor DOWN
; KEY80E=0xff54, 0xff54 ; (XK_Down, XK_Down); just the same
Examples of remapping Suppose that you selected to use the us.kmf file (with the Xsettings utility) and you want to change the keyboard mapping for Up(8) and Down(2) keys of the additional keyboard and for the F1 key. You can find the following lines in the us.kmf file for them: KEY59=0xffbe, 0xffbe ; (XK_F1,XK_F1) By using the "xev" or "xmodmap -pk" commands on the SUN Xserver, you can get keysyms for all keys. For example, you choose: Help=0xff6a; If you modify the lines of the us.kmf file as follows: KEY59=0xff6a, 0xff6a ;(Help,Help) you will emulate the "Help" (F1), "Copy" ("Down") and "Paste" ("Up") functions of the SUN keyboard. The COMPOSERS_XKK Section In many European languages (especially in France, Belgium and Holland), users need to enter some special characters by combining a Diacritic (or composer) character and a normal letter. For example, the user enters first the '^' sign and then the 'a' character, then this should result in the 'b' keysym. The [KEYS] section does not determine composer characters. The Composers are only defined in the [COMPOSERS_XKK] section. In the [COMPOSERS_XKK] section, each composer statement associates a set of key_ number map pairings with a keysym value. Synopsis of the composer statement is: COMPxx = key_number > key_number[S] [, key_number > key_number[S] ... ] In the composer entry, COMP is the entry name and 'xx' is a decimal keysym value for a composer key (in the range of character codes). The '>' sign defines single code mapping (from the left to the right), while a comma separates possible map pairings. The 'S' character, if exists, allows both cases for a key_number mapping pair, otherwise lower case only. If for a keysym value 'xx' of a key (say, KEYcc), a composer entry COMPxx exists in the [COMPOSERS_XKK] section (i.e. the XServer can find it there), then the 'cc' value will not be sent to the XClient (otherwise, it will). In the composer case, the XServer will save the keysym value 'xx' until the user presses the next key. If the next key (say, KEYyy) is in the COMPxx entry (like 'yy > zz' in a pair), then the XServer will send the value 'zz' from the pair to the XClient. If 'yy' is not found in the COMPxx entry, then the XServer will send the composer's key_number 'cc' and the second key_number 'yy'. Note that the values 'yy' and 'zz' are in the range of character codes. Note that if Composer is pressed twice, then the XServer will send the single value 'cc' to the XClient.
Example:
[KEYS]
KEY18 = 0x65, 0x45 ; (XK_e, XK_E)
KEY22 = 0x75, 0x55 ; (XK_u, XK_U)
KEY23 = 0x69, 0x49 ; (XK_i, XK_I)
KEY24 = 0x6f, 0x4f ; (XK_o, XK_O)
KEY30 = 0x61, 0x41 ; (XK_a, XK_A)
KEY41 = 94, 176 ; Circumflex Accent (^) /
DEGREE SIGN, RING ABOVE
; KEY41 = 0x5e, 0xb0 ; (XK_asciicircum, XK_degree)
KEY162 = 0xe2, 0xc2 ; (XK_acircumflex, XK_Acircumflex)
KEY170 = 0xea, 0xca ; (XK_ecircumflex, XK_Ecircumflex)
KEY174 = 0xee, 0xce ; (XK_icircumflex, XK_Icircumflex)
KEY180 = 0xf4, 0xd4 ; (XK_ocircumflex, XK_Ocircumflex)
KEY187 = 0xfb, 0xdb ; (XK_ucircumflex, XK_Ucircumflex)
[COMPOSERS_XKK]
; Definition of Circumflex Accent as a composer
COMP94=30>162S,18>170S,23>174S,24>180S,22>187S
In this example, if the user presses (normally) the key
41 which is the circumflex accent (on German keyboard), the XServer will
check if the keysym value 94 is found in the [COMPOSERS_XKK] section (the
COMP94 entry), and if yes, then the XServer will wait until the user enters
the next character. If the next character is in the COMP94 entry (in our
case 30), then the XServer will send 162 to the Xclient (both cases are
allowed). If the second key_number is not found in the COMP94 entry, then
the XServer will send the composer's key_number (in our case 41) and the
second key_number. |
ftpAxe 1.5 |
||||||||
| © LabF. All rights reserved. Privacy policy e-mail us at: sales@labf.com | ||||||||||