Edit

kc3-lang/libxkbcommon/test/data/compat/iso9995-v2

Branch :

  • Show log

    Commit

  • Author : Pierre Le Marre
    Date : 2025-06-12 09:13:27
    Hash : d9d82355
    Message : keymap: Add option `lockOnRelease` for LockGroup() It enables to use e.g. the combination `Control + Shift` *alone* to switch layouts, while keeping the use of `Control + Shift + other key` (typically for keyboard shortcuts). The specification of `LockGroup()` is changed to: - On key *press*: - If `lockOnRelease` is set, then key press has no effect. - Otherwise: - if the `group` is absolute, key press sets the *locked* keyboard group to `group`; - otherwise, key press adds `group` to the *locked* keyboard group. In either case, the resulting *locked* and *effective* group is brought back into range depending on the value of the `GroupsWrap` control for the keyboard. - On key *release*: - If `lockOnRelease` is not set, then key release has no effect. - Otherwise, if any other key was *pressed* after the locking key, then key release has no effect. - Otherwise, it has the same effect than a key press *without* `lockOnRelease` set. This is really useful for people coming from other platforms, such as Windows. It fixes a [20-year old issue] inherited from the X11 ecosystem, by extending the [XKB protocol key actions]. As it is incompatible with X11, this feature is available only using the keymap text format v2. [20-year old issue]: https://gitlab.freedesktop.org/xorg/xserver/-/issues/258 [XKB protocol key actions]: https://www.x.org/releases/current/doc/kbproto/xkbproto.html#Key_Actions

  • test/data/compat/iso9995-v2
  • default partial
    xkb_compatibility "lockOnPress" {
    
        virtual_modifiers AltGr;
    
        interpret.repeat= False;
    
        interpret ISO_Next_Group {
    	useModMapMods= level1;
    	virtualModifier= AltGr;
    	action= LockGroup(group=+1, lockOnRelease=false);
        };
    
        interpret ISO_Prev_Group {
    	useModMapMods= level1;
    	virtualModifier= AltGr;
    	action= LockGroup(group=-1, lockOnRelease=false);
        };
    
        interpret ISO_First_Group {
    	action= LockGroup(group=1, lockOnRelease=false);
        };
    
        interpret ISO_Last_Group {
    	action= LockGroup(group=2, lockOnRelease=false);
        };
    };
    
    partial
    xkb_compatibility "lockOnRelease" {
    
        virtual_modifiers AltGr;
    
        interpret.repeat= False;
    
        interpret ISO_Next_Group {
    	useModMapMods= level1;
    	virtualModifier= AltGr;
    	action= LockGroup(group=+1, lockOnRelease);
        };
    
        interpret ISO_Prev_Group {
    	useModMapMods= level1;
    	virtualModifier= AltGr;
    	action= LockGroup(group=-1, lockOnRelease);
        };
    
        interpret ISO_First_Group {
    	action= LockGroup(group=1, lockOnRelease);
        };
    
        interpret ISO_Last_Group {
    	action= LockGroup(group=2, lockOnRelease);
        };
    };