Edit

kc3-lang/libxkbcommon/test/data/rules/wildcard

Branch :

  • Show log

    Commit

  • Author : Pierre Le Marre
    Date : 2024-08-20 16:41:38
    Hash : 05ba96db
    Message : rules: Fix wild card handling The handling of wild card `*` is different in libxkbfile and X server: wild card matches empty strings for model and option but not for layout nor variant, while in libxkbcommon wild cards always match empty strings. See: - https://gitlab.freedesktop.org/xorg/lib/libxkbfile/-/blob/bf985c68acb1244f51ec91414532a2347fbc1c4c/src/maprules.c#L687 - https://gitlab.freedesktop.org/xorg/lib/libxkbfile/-/blob/bf985c68acb1244f51ec91414532a2347fbc1c4c/src/maprules.c#L712 The difference of handling between the components is unfortunately not documented, but we should follow the behavior of the original implementations for consistency. - Fixed by implementing the same behavior than libxkbfile. - Added tests and fixed failing tests. - Improve the documentation of rules to highlight the special behavior.

  • test/data/rules/wildcard
  • ! model = keycodes
      *     = evdev
    
    ! model = geometry
      *     = pc(pc104)
    
    ! layout variant = symbols
      *      *       = pc+%l%(v)
    
    ! layout[1] variant[1] = symbols
      *         *          = pc+%l[1]%(v[1])
    
    ! layout[2] variant[2] = symbols
      *         *          = +%l[2]%(v[2]):2
    
    ! layout[3] variant[3] = symbols
      *         *          = +%l[3]%(v[3]):3
    
    ! layout[4] variant[3] = symbols
      *         *          = +%l[4]%(v[4]):4
    
    ! model layout = compat
      *     *      = complete
    
    ! model layout[1] = compat
      *     *         = complete
    
    ! model layout[2] = compat
      *     *         = complete
    
    ! model = types
      *     = complete