First, is this the right forum for me to ask for assistance (hopefully
only a small amount of guidance) with creating a Devanagari keymap for
XFree86 4.3.0?  I'm updating the Devanagari / Hindi keymap to support the
multiple language/layout functionality in 4.3.0, and also including a few
keys that were previously left out, but specified by INSCRIPT and Unicode
for Devanagari/Hindi.

Second, is this approach "the right one"? -->
        I've abandoned the idea of using AltGr, and instead left the RALT
        and ISO_Level3_Shift stuff out of my symbol table in exchange for
        loading the map with -option "lv3:switch"  -->

        setxkbmap -rules xfree86 -model pc104 -layout "us,dev" \
        -option "grp:shift_toggle" -option "lv3:switch" -variant ",extra"

Third, could someone review my attached Devanagari keyboard map, and tell
me if I'm doing any of this properly??  :)  I believe the symbol mappings
are correct, so I'm just looking for "stylistic" / functionality advice.  
(but if you spot something wrong with the symbols, please tell me!)

-- David


On Tue, 2 Sep 2003, David Holl wrote:

> I'm having trouble using FOUR_LEVEL key groups ---- Here's an example xkb 
> map to remap my space bar to produce the letters A, B, C, D:
> 
> partial default alphanumeric_keys
> xkb_symbols "basic" {
>       key.type[Group1]="FOUR_LEVEL";
>       key <SPCE> { [ A, B, C, D ] };
>       key <RALT> { type[Group1]="TWO_LEVEL", [ ISO_Level3_Shift, Multi_key ] };
> };
> 
> >From my understanding, this map should function like this:
>       Space             -> A
>       Shift+Space       -> B
>       AltGr+Space       -> C
>       AltGr+Shift+Space -> D
> 
> So I place the map in my X11/xkb/symbols/pc directory (with the rest of
> the maps) and load it with:
> 
>       setxkbmap -rules xfree86 -model pc104 -layout "us,space" \
>               -option "" -option "grp:ctrl_shift_toggle"
> 
> But at a command line (xterm/tcsh), the A & B mappings work, but pressing
> AltGr+Space or AltGr+Shift+Space does not produce C or D, respectively.
> 
> However, I tried xev ("print contents of X events"), and I can see the
> A,B,C,D keysyms just fine (below).  Any idea what's wrong?  Could the
> application still be trying to interpret the AltGr key or something?
> 
> I'm running XFree86 4.3.0.  (if that helps...)
> 
> KeyPress event, serial 26, synthetic NO, window 0x1600001,
>     root 0x48, subw 0x0, time 332437917, (85,65), root:(1422,86),
>     state 0x2000, keycode 65 (keysym 0x41, A), same_screen YES,
>     XLookupString gives 1 bytes:  "A"
> ...
> KeyPress event, serial 26, synthetic NO, window 0x1600001,
>     root 0x48, subw 0x0, time 332438995, (85,65), root:(1422,86),
>     state 0x2001, keycode 65 (keysym 0x42, B), same_screen YES,
>     XLookupString gives 1 bytes:  "B"
> ...
> KeyPress event, serial 26, synthetic NO, window 0x1600001,
>     root 0x48, subw 0x0, time 332440895, (85,65), root:(1422,86),
>     state 0x2008, keycode 65 (keysym 0x43, C), same_screen YES,
>     XLookupString gives 1 bytes:  "C"
> ...
> KeyPress event, serial 26, synthetic NO, window 0x1600001,
>     root 0x48, subw 0x0, time 332442642, (85,65), root:(1422,86),
>     state 0x2009, keycode 65 (keysym 0x44, D), same_screen YES,
>     XLookupString gives 1 bytes:  "D"
// This is a Devanagari/Hindi keyboard layout for XFree86 4.3.0 with a
// pc104/us keyboard.
//
// Change log:
// David Holl <[EMAIL PROTECTED]>
//      . moved keys to Group1 out of Group2 for XFree86 4.3.0 friendliness
//      . added a few extra keys to match the Unicode and INSCRIPT definitions
//              (like ZWNJ & ZWJ)
//      . added example usage: setxkmap & XF86Config
//
// setxkbmap -rules xfree86 -model pc104 -layout "us,dev" \
//      -option "grp:shift_toggle" -option "lv3:switch" -variant ",extra"

partial default alphanumeric_keys
xkb_symbols "basic" {
        include "pc/dev(bare)"
};

partial alphanumeric_keys
xkb_symbols "extra" {
        include "pc/dev(bare)"

        key.type[Group1]="FOUR_LEVEL";

// I want to be able to type \ / ? | for file names and piping...
        key <AB10> { [ U092f, U095f,      slash,   question ] };
        key <BKSL> { [ U0949, U0911,  backslash,        bar ] };

// I also wanted to be able to type nifty circle glyph such as when
// demo'ing the modifiers, vowels, combining characters, etc...
        // space, circle, ZWNJ, ZWJ:
        key <SPCE> { [ space, U25cc,      U200c,      U200d ] };
};

hidden partial alphanumeric_keys 
xkb_symbols "bare" {
        name[Group1]="Devanagari";

        key.type[Group1]="FOUR_LEVEL";

        key <TLDE> { [ U094a, U0912,  grave,  asciitilde ] };
        key <AE01> { [ U0967, U090d,      1,      exclam ] };
        key <AE02> { [ U0968, U0945,      2,          at ] };
//AE03-AE08 really need to return a macro of keys defined by INSCRIPT
//in place of the NoSymbol's that are here for now.
// How do I get XKB to let 1 key translate to pressing 2-3 other keys?
        key <AE03> { [ U0969, NoSymbol,   3,  numbersign ] };
        key <AE04> { [ U096a, NoSymbol,   4,      dollar ] };
        key <AE05> { [ U096b, NoSymbol,   5,     percent ] };
        key <AE06> { [ U096c, NoSymbol,   6, asciicircum ] };
        key <AE07> { [ U096d, NoSymbol,   7,   ampersand ] };
        key <AE08> { [ U096e, NoSymbol,   8,    asterisk ] };
        key <AE09> { [ U096f, parenleft,  9,   parenleft ] };
        key <AE10> { [ U0966, parenright, 0,  parenright ] };
//I'm debating between which of the two following lines is correct:
//      key <AE11> { [ U0903, U0903, minus, underscore ] };
        key <AE11> { [ NoSymbol, U0903, minus, underscore ] };
        key <AE12> { [ U0943, U090b, U0944, U0960 ] };

        key <AD01> { [ U094c, U0914 ] };
        key <AD02> { [ U0948, U0910 ] };
        key <AD03> { [ U093e, U0906 ] };
        key <AD04> { [ U0940, U0908, U0963, U0961 ] };
        key <AD05> { [ U0942, U090a ] };
        key <AD06> { [ U092c, U092d ] };
        key <AD07> { [ U0939, U0919 ] };
        key <AD08> { [ U0917, U0918, U095a ] };
        key <AD09> { [ U0926, U0927 ] };
        key <AD10> { [ U091c, U091d, U095b ] };
        key <AD11> { [ U0921, U0922, U095c, U095d ] };
        key <AD12> { [ U093c, U091e ] };
        key <BKSL> { [ U0949, U0911 ] };

        key <AC01> { [ U094b, U0913 ] };
        key <AC02> { [ U0947, U090f ] };
        key <AC03> { [ U094d, U0905 ] };
        key <AC04> { [ U093f, U0907, U0962, U090c ] };
        key <AC05> { [ U0941, U0909 ] };
        key <AC06> { [ U092a, U092b, NoSymbol, U095e ] };
        key <AC07> { [ U0930, U0931 ] };
        key <AC08> { [ U0915, U0916, U0958, U0959 ] };
        key <AC09> { [ U0924, U0925 ] };
        key <AC10> { [ U091a, U091b, U0952 ] };
        key <AC11> { [ U091f, U0920, NoSymbol, U0951 ] };

        key <AB01> { [ U0946, U090e, U0953 ] };
        key <AB02> { [ U0902, U0901, NoSymbol, U0950 ] };
        key <AB03> { [ U092e, U0923, U0954 ] };
        key <AB04> { [ U0928, U0929 ] };
        key <AB05> { [ U0935, U0934 ] };
        key <AB06> { [ U0932, U0933 ] };
        key <AB07> { [ U0938, U0936 ] };
        key <AB08> { [ comma, U0937, U0970 ] };
        key <AB09> { [ period, U0964, U0965, U093d ] };
        key <AB10> { [ U092f, U095f ] };
};

Reply via email to