Re: Alt + CHTN for arrow key movement, XKB?

Ahmad Baitalmal <[email protected]>
Newsgroups gmane.comp.xfree86.internationalization
Message-ID <[email protected]>
Ivan,
Thank you for your reply, I'm almost there.
When I added the new type to types/basic I try compiling using this command

 setxkbmap dvorak -print | xkbcomp - $DISPLAY

This is what I get:

Error:            Identifier "Alt" of type int is unknown
Error:            Key type mask field must be a modifier mask
                  Key type definition ignored
Warning:          Map entry for unused modifiers in ALT_ALPHABETIC
                  Using none instead of Shift
Warning:          Map entry for unused modifiers in ALT_ALPHABETIC
                  Using none instead of Lock


I've looked at other files in that folder like types/mousekeys and I found that
there is a "virtual_modifiers Alt;" at the top. I tried doing the same in
types/basic. The error messages is gone, but it's not working.

I would appriceate any more help from you.
Ahmad

______________________________________________________________________________
You misunderstood the meaning of modifiers in 'interpret' records.

What you need is the adding the third keysym to keys that now have two keysyms
and make its choice depending on LeftAlt key (or Alt modifier).

These letter keys have xkb type 'ALPHABETIC'.  In short it means
 * none modifier key is presed - use the first level keysym
 * Shift modifier bit is set - use the second level keysym
You need a new type for these keys with an additional 'rule'
 * Alt modifier bit is set - use the third level keysym.

OK. Take the description of the 'ALPHABETIC' type in /xkb/types/basic , copy it
and give it any arbitrary name (e.g. 'ALT_ALPAHBETIC')
The original description is
    type "ALPHABETIC" {
        modifiers = Shift+Lock;
        map[Shift] = Level2;
        map[Lock] = Level2;
        level_name[Level1] = "Base";
        level_name[Level2] = "Caps";
    };
Our new type should looks like
    type "ALT_ALPHABETIC" {
        modifiers = Shift+Lock+Alt;
        map[Shift] = Level2;
        map[Lock] = Level2;
        map[Alt] = Level3;
        level_name[Level1] = "Base";
        level_name[Level2] = "Caps";
        level_name[Level3] = "Arrows";
    };
(probably you want to add a rule for [Lock+Alt] combination too)

Now you can change your letter keys in the way
was:
    key <AB03> {        [         c,    C               ]       };
become:
    key <AB03> { type="ALT_ALPHABETIC",
                        [   c,   C,  Up  ]       };
etc.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.