Bug 78139 - Question: Are CTRL+ALT and FOUR_LEVEL_X correct?
Summary: Question: Are CTRL+ALT and FOUR_LEVEL_X correct?
Status: RESOLVED MOVED
Alias: None
Product: xkeyboard-config
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: Other All
: medium trivial
Assignee: xkb
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-01 00:24 UTC by Hanno Zulla
Modified: 2018-12-28 00:52 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Hanno Zulla 2014-05-01 00:24:51 UTC
Hi,

sorry to ask questions via bugzilla, but here's something odd in the xkb definitions.

I'm trying to make an xkb layout for a Chromebook. These come with a limited set of keys for ease of use and then make missing keys available through modifiers, e.g.:

Up = <UP>
Prior = Alt+<UP>
Home = Ctrl+Alt+<UP>

(see https://support.google.com/chromebook/answer/1047364?hl=en)

Anyways, as a beginner to xkb I thought that FOUR_LEVEL_X or CTRL+ALT would be the right types to use for this. But these use both the Level3 and the Alt modifier.

So when trying to use this:

    key <UP> {
      type="CTRL+ALT",
      repeat=yes,
      symbols[Group1] = [Up, Up, Prior, Prior, Home ],
      actions[Group1] = [
        NoAction(),
        NoAction(),
        RedirectKey(key=<PGUP>, clearmods=Alt),
        RedirectKey(key=<PGUP>, clearmods=Alt),
        RedirectKey(key=<HOME>, clearmods=Control+Alt)
      ]
    };

What you get is this with a German keyboard:

Up = <UP>
Prior = AltGr+<UP>
Home = Ctrl+Alt+<UP>

Now this is odd. Shouldn't it be Alt and Ctrl+Alt, but not AltGr in one case and Ctrl+Alt in the other? So which is correct, Alt or AltGr?

The same oddity occurs for FOUR_LEVEL_X, if I read that correctly.

Is this desired behaviour?

Thanks!
Comment 1 Sergey V. Udaltsov 2014-05-01 22:49:52 UTC
Yes it is desired. In this context Alt and AltGr as identical.
Comment 2 Hanno Zulla 2014-05-02 08:03:53 UTC
But Alt and AltGr are not identical on my German keyboard layout.

If I use the type "CTRL+ALT" on a German layout, the result is that Level3 is AltGr (or: the key on the right side) and Level5 is Ctrl + Alt (or: the two keys on the left side).

Sorry, that doesn't make sense.

If Alt and AltGR are identical in the context that CTRL+ALT being used for right now, then this:

   type "CTRL+ALT" {
        modifiers = Control+Alt+Shift;
        map[None] = Level1;
        map[Shift] = Level2;
        map[Alt] = Level3;
        map[Shift+Alt] = Level4;
        map[Control+Alt] = Level5;
        preserve[Shift] = Shift;
        preserve[Shift+Alt] = Shift;
        level_name[Level1] = "Base";
        level_name[Level2] = "Shift";
        level_name[Level3] = "Alt Base";
        level_name[Level4] = "Shift Alt";
        level_name[Level5] = "Ctrl+Alt";
    };

would still work in the as before in the old context *and* it would also work as expected for my new use case.

Or am I missing something?
Comment 3 Sergey V. Udaltsov 2014-08-18 00:01:59 UTC
Ok, let me expand. Look at CTRL+ALT definition.

The switch to Level3 happens on LevelThree modifier - and AltGr (in German layout) is assigned to LevelThree modifier. So here you get AltGr + UP = LevelThree modifier to UP.

The switch to Level5 happens on combination of Control and Alt modifiers. So you have Ctrl+Alt keys, provoding those modifiers (Alt key is bound to Alt modifier).

My understanding is that there was no intention to use "same" alt for level 3 and level 5.
Comment 4 GitLab Migration User 2018-12-28 00:52:42 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/issues/134.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.