Skip to content

Unreachable levels are not dropped #50

@wismill

Description

@wismill

Since #20 the following:

xkb_keymap {
  xkb_keycodes { <rightalt> = 1; };
  xkb_compat {
      virtual_modifiers LevelThree = Mod5;
      interpret ISO_Level3_Shift + AnyOfOrNone(all) {
          virtualModifier = LevelThree;
          action = SetMods(mods = LevelThree);
      };
  };
  xkb_symbols {
      key <rightalt> {
          [ Alt_R, Meta_R ],
      };
      key <rightalt> {
          type = "ONE_LEVEL",
          [ ISO_Level3_Shift ],
      };
      modmap Mod1 { Meta_R };
  };
};

compiles to:

xkb_keymap {
    xkb_keycodes {
        minimum = 8;
        maximum = 255;

        indicator 1 = "DUMMY";

        <rightalt> = 1;
    };

    xkb_types {
        virtual_modifiers LevelThree = Mod5;

        type "ONE_LEVEL" {
            modifiers = None;
            level_name[Level1] = "Any";
            map[None] = Level1;
        };
    };

    xkb_symbols {
        key.repeat = true;

        key <rightalt> {
            repeat = false,
            type[Group1] = "ONE_LEVEL",
            symbols[Group1] = [ ISO_Level3_Shift, Meta_R ],
            actions[Group1] = [ SetMods(modifiers = Mod5), NoAction() ]
        };
    };
};

Why not dropping the second level with Meta_R completely when setting type = "ONE_LEVEL", if it is not the level is not reachable? I think it should not even trigger interprets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions