xkb - problems using virtual keys and ISO_Level3_Shift key

cheater00 . cheater00 at gmail.com
Tue May 20 16:35:39 PDT 2014


Hi Andreas,

thanks a lot for your reply. There are some really cool ideas there
that I just have to try!

BTW, I just noticed the subject was wrong.

On Tue, May 20, 2014 at 8:34 PM,  <wettstae at gmail.com> wrote:
>> 2. In some places, the ISO_Level3_Shift key is intercepted. This is
>> especially painful on websites that have a search field. An example is
>> http://dict.leo.org.
>
> I cannot reproduce this.  When I open this webpage with firefox, the
> cursor is placed to the search field right away.  If I move it out of
> it, pressing my ISO_Level3_Shift keys does not move it in.
>
>> the website notices I'm holding what it thinks is AltGr (after all
>> they're the same key)
>
> According the debug output you sent yesterday, your AltGr key is a
> Alt/Meta key, not a ISO_Level3_Shift key:
>
>     key <RALT> {
>         type= "TWO_LEVEL",
>         symbols[Group1]= [           Alt_R,          Meta_R ]
>     };

Yes, the right Alt key maps to Alt_R. What I meant was that
ISO_Level3_Shift and AltGr are the same logical key. They're the same
thing. That is: if your keyboard layout has an AltGr key, it's likely
to be ISO_Level3_Shift. And following this logic, Firefox makes them
the same thing. Look here:

https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent

find the table called "When getModifierState() returns true on
Gecko?"; it says that Firefox thinks "AltGraph" is set if the "Level 3
Shift key" or "Level 5 shift key" are pressed.

Anyways, that output was for when the layout was being compiled
incorrectly (types not being resolved); this is new:

http://lpaste.net/1670210531127984128

>> I tried redirecting to <LEFT> like this in the symbols file:
>>
>>     key <AC08> {
>>     type[Group1]="THREE_LEVEL_SHIFTABLE",
>>     symbols[Group1]=[    h, H, Left, Left    ],
>>     actions[Group1]=[ NoAction(), NoAction(), RedirectKey(key=<LEFT>),
>> RedirectKey(key=<LEFT>, modifiers=Shift) ] };
>
> Again according to your output from yesterday, LEFT is an
> ISO_Level3_Shift:
>
>     key <LEFT> {
>         type= "ONE_LEVEL",
>         symbols[Group1]= [ ISO_Level3_Shift ]
>     };
>
> I am not sure what your goal here is.

One of the keyboards I use has the arrows scrunged up in the lower
right corner and I remapped them to control, alt, level 3, etc so that
I can press them with the outside of the palm of my hand like I
normally do on full-sized keyboards.


>> - by removing (commenting out) the lines that made ISO_Level3_Shift get mapped to Mod5:
>
> If you do this completely, LevelThree will no longer be associated to
> Mod5, and ISO_Level3_Shift will stop working.

Not true in my case - I removed them from my symbols file and
ISO_Level3_Shift didn't stop working.

>> At this point I'm seriously out of ideas; does anyone have any
>> pointers?
>
> You might try out something like this:
>
>     key <FK01> {
>         type= "ONE_LEVEL",
>         symbols[Group1]= [ ISO_Level3_Shift ],
>         actions[Group1]= [ SetMods(modifiers=Mod5) ]
>     };
>     key <FK02> {
>         type= "ONE_LEVEL",
>         symbols[Group1]= [ ISO_Level3_Shift ],
>         actions[Group1]= [ SetMods(modifiers=Shift) ]
>     };
>     key <FK03> {
>         type= "ONE_LEVEL",
>         symbols[Group1]= [ Shift_L ],
>         actions[Group1]= [ SetMods(modifiers=Mod5) ]
>     };
>     key <FK04> {
>         type= "ONE_LEVEL",
>         symbols[Group1]= [ Shift_L ],
>         actions[Group1]= [ SetMods(modifiers=Shift) ]
>     };
>
> to see whether the behaviour is related to the keysym ISO_Level3_Shift
> or the modifier Mod5 it usually sets.

Thanks, I'll try that tomorrow, sounds like a way to debug!

> Or maybe the problem is specific
> to the RALT key?

Not likely since the RALT key has nothing to do with ISO_Level3_Shift
which is currently on: the left arrow, the right menu key, and the
left alt key.

>> 3. This doesn't work in the editing window in Skype. This is the only
>> place this doesn't work; normal cursors work, but pressing
>> ISO_Level3_Shift+h just doesn't move the cursor at all.
>
> Here, a RedirectKey like you were using above could help (provided that
> you redirect to a key that has an appropriate keysym on it).
> clearMods=Mod5 might be useful as well for such a RedirectKey.

I haven't tried with clearMods. However, ISO_Level3_Shift didn't do
much. Maybe it's because I redirected to <LEFT> and <LEFT> evaluated
to ISO_Level3_Shift? So can it be in the end I was redirecting
ISO_Level3_Shift+h to ISO_Level3_Shift?

>> I noticed that if I press ISO_Level3_Shift and try to use one of the
>> physical cursor keys the cursor doesn't move either;
>
> According to your debug output, none of UP, LEFT, RGHT, and DOWN are
> mapped to a cursor motion keysym, so that would be little surprising.

Home, end, page up and down are cursor keys too. You're thinking of arrow keys.

> That said, some applications might be confused by the Mod5 modifier
> being set when you press a cursor key together with a ISO_Level3_Shift
> key.  Redirecting the cursor key to itself and using clearMods=Mod5
> might help for such cases.

I'll try and see if that works, interesting idea.


More information about the xorg mailing list