Re: Re: Alt + CHTN for arrow key movement, XKB?
Ivan Pascal <[email protected]>
| Newsgroups | gmane.comp.xfree86.internationalization |
|---|---|
| Message-ID | <[email protected]> |
Hi,
Sorry for the delay. This task appeared more complex than I thought.
> Ahmad Baitalmal <ahmad <at> baitalmal.com> writes:
>
> So I think I'm even closer,
> I ran xev to see what I'm getting.
> It seems to be sending "Up" when I hit Alt+C which is perfect, but the state is
> modified to 0x8 whick means that the Alt key is pressed (right?). So what's
> being sent is really Alt-Up.
Yes. This Alt modifier 'spoils' the combination.
> So ho do I cancel that Alt and just send Up?
There is a way to do that. XKB allows to tie so called 'actions' to a key
besides keysym. And there is a special action RedirectKey that allows to
emulate any other key event with needed modifiers.
In the keymap you can specifiy in addition to keysyms an actions list:
key <AB03> { type="ALT_ALPHABETIC",
[ c, C, Up ],
actions[Group1]= [ ..... ] };
(Note, there should be comma after the keysyms list.)
Since first two cells in the list (corresponed to c, C keysyms cells) don't need
an action you have to fill them with 'NoAction()' word.
And the action for third cell can look like
Redirect(key=<UP>, clearmods=Alt)
Note, the 'key' there is not a keysym but a keycode name because the action is
processed on the server side and emulates a press of another physycal key.
But unfortunately this feature is still buggy.
First of all XKB doesn't understand <UP> there probably because this name is
too short (it understands <DOWN> or, say, <END> well). I'll fix it bug but
now I can offer a workaround only. Add to the xkb/keycodes/xfree86 file
(somewhere at the end of the first section) the line
alias <UPAR> = <UP>;
(just another name for the <UP> physical key)
and use this name in the redirect action
actions[Group1]= [NoAction(),NoAction(), Redirect(key=<UPAR>, clearmods=Alt)]};
But the second bug is worse. Any RedirectKey action causes a server crash in
XFree up to 4.3.0 version. It was fixed in May 2003 (after 4.3.0 release)
and you can use this feature only if your Xserver is based on some
intermediate releases issued after this month.
And if you will try this action don't forget to add
virtual_modifiers Alt;
into your xkb/symbols/* file.
> Also, I will need Shift+Alt-C to send Shift-Up, where can I do that?
It's simplier. Add into new type description an additional line for Shift+Alt
combination:
type "ALT_ALPHABETIC" {
modifiers = Shift+Lock+Alt;
....
map[Alt+Shift] = Level3;
...
};
Since it leads to the same level and the same Redirect action the combination
Shift+Alt-C emulates the same <UP> key with Shift but without Alt.
--
Ivan U. Pascal | e-mail: [email protected]
Administrator of | Tomsk State University
University Network | Tomsk, Russia