summaryrefslogtreecommitdiff
path: root/rules
AgeCommit message (Collapse)AuthorFilesLines
7 daysRenaming Macintosh vendor layouts for consistencyHEADmasterPierre Le Marre2-2/+1
Use the pattern `Language ([country, ]Macintosh[, variant])` everywhere. Note that we may want to replace `Macintosh` by `macOS`, unless the variant is specific to a legacy keyboard model/OS. Follow-up of 595342a90876efb2f60a488b702ef03f90c62e35 Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/833>
7 daysMinor fixes related to Apple layoutsPierre Le Marre2-2/+3
Improve release notes and ensure consistency in naming. Follow-up of 59398cfb4ed43f56d21e5463b4ad2feb01b1fe65 Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/833>
13 daysAdd Macintosh ISO US keyboard layout variantsKatalin Rebhan1-2/+14
Signed-off-by: Katalin Rebhan <me@dblsaiko.net> Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/829>
2025-05-28compat: Fix input method keys triggering CapsLockPierre Le Marre5-0/+10
Some Japanese layouts have input method keys such as `Eisu_toggle` on the CapsLock key, making them triggering the `Lock` modifier thanks to the following entry in `compat/basic`: ```c interpret Any+Lock { action= LockMods(modifiers=Lock); }; ``` This is mitigated with `compat/japan`, but only when the layout is in first position. Fixed by ensuring that rules always add `compat/japan` for Japanese layouts, independently of their position. Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/803>
2025-05-28compat: Fix redundant +complete for jp layoutsPierre Le Marre3-3/+3
Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/803>
2025-05-01rules: fix Apple ISO keyboards International English layoutAndrey Butirsky4-0/+4
Fixes: 595342a9 ("Apple: fix ISO keyboards International English layout") for keymaps with several groups Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/812>
2025-02-27Apple: fix ISO keyboards International English layoutAndrey2-0/+2
Apple uses slightly modified variants of standard layouts in their ISO keyboards. Additionally, they swapped the scancodes of `<TLDE>` and `<LSGT>`, adding to the mess. Now that the scancodes are properly auto-corrected by the `hid_apple` kernel module, we can adjust our keymaps to match physical layouts. This patch: - fixes the “International English” layout found as standalone and also in some dual language ISO keyboards (Arabic, Russian, Ukrainian, etc.); - adds the vendor-specific variant `macintosh_vndr/us(applealu_iso)`. Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/793>
2025-02-25Add hyper:mod4 optionPierre Le Marre1-1/+7
Currently when using any option enabling `Hyper`, the virtual modifier `Hyper` is mapped to `Mod3`. But this mapping conflicts with `LevelFive` and leave layouts with 5+ levels unable to use both modifiers independently. Added the option `hyper:mod4` to allow to choose the alternative mapping of `Hyper` to `Mod4`. Note that this mapping conflicts with `Super`. The rationale is: - We have only a limited number of *real* modifiers available to use for the *virtual* modifiers[^1]. - `Hyper` has a niche use (mainly Emacs), so it should have lower priority than the use cases for `Super` and `LevelFive` (see hereinafter). - `Super` is commonly used to control desktop environments, so it should always be functional by default. - `LevelFive` is used in layouts with 5+ levels, so it should always be functional by default. However, it seems its use cases are less common than `Super`, so it seems safer to default `Hyper` to `Mod3/LevelFive` than to `Mod4/Super`. [^1]: Note that this limit will be removed soon in libxkbcommon, allowing arbitrary independent modifiers. Signed-off-by: Pierre Le Marre <dev@wismill.eu> Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/760>
2025-02-25Add option hyper:mod3 and remove default Hyper mappingPierre Le Marre1-0/+6
The default modifier mapping of `Hyper` conflicts with `LevelFive`, which is a required modifier for various layouts. However, `Hyper` can be used only via options, so it makes sense to make its modifier mapping optional. Added option `hyper:mod3` to enable the `Hyper` virtual modifier by mapping it to `Mod3`. Signed-off-by: Pierre Le Marre <dev@wismill.eu> Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/760>
2025-02-20Add Swedish Colemak keyboard layoutsatricus1-0/+6
Signed-off-by: satricus <fl.vincent.sinclair@gmail.com> Co-authored-by: satricus <fl.vincent.sinclair@gmail.com> Co-authored-by: Pierre Le Marre <dev@wismill.eu> Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/761>
2025-02-20jp(kana86): Delete obsolete layoutPierre Le Marre1-6/+0
This layout was introduced by: - Original issue: https://bugs.freedesktop.org/show_bug.cgi?id=31340 - Original commit: 240a40cbd3c2dea858e84868d423b3d826efa2dc The layout is unmaintained and has the following issues: - `jp(kana)` is mostly overwritten. - `altwin(menu)`` is the default in pc - `keypad(numoperdecsep)` does not work because the keycodes are not defined anymore. Or I do not see how to load them (`sgi_vndr/indy`) with the current rules. Unless I missed something, this is basically just `jp(OADG109A)`, so let’s delete `jp(kana86)` and its counterpart `sun_vndr/jp(kana86)`. Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/808>
2025-02-20Ruff format Python codeHåvard Bærug2-5/+6
Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/802>
2025-02-20Pyupgrade syntax to Python3.9+Håvard Bærug2-5/+6
Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/802>
2025-02-20Fix end-of-files and trim trailing whitespacesHåvard Bærug1-3/+3
Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/802>
2024-12-11Fix $applealu vendor rulePierre Le Marre1-10/+10
Only the rule containing `$macvendorlayouts(*)` is problematic, but let’s always use `%(v…)` form instead of `(%v…)`. Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/786>
2024-12-10rules: Rename file indexesPierre Le Marre34-50/+50
This facilitate changing the order of the file and adding new ones. Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/785>
2024-11-29Fix vendor rulesPierre Le Marre10-23/+105
Some vendor rules match only on the layout but use the variant in their symbols mapping. Such rules will make the keymap compilation fail when a variant is not in the vendor-specific symbol file. Example: the following rule ! model layout = symbols $applealu $macvendorlayouts = macintosh_vndr/apple(alukbd)+macintosh_vndr/%l%(v) used with the RMLVO (evdev; applealu_iso; gb; mac_intl) would produce the following erroneous symbols include: macintosh_vndr/apple(alukbd)+macintosh_vndr/gb(mac_intl) This fails because `mac_intl` is not a variant of `macintosh_vndr/gb`, but of `gb`. This commit fixes the issue by filtering vendor-specific variants, having the vendor-agnostic symbols as a fallback. Note that while it works perfectly for layouts in the first position, layouts in later positions that have 1) a corresponding vendor-specific file but 2) require a vendor-agnostic variant, will load the vendor- specific symbols before importing the relevant section. To illustrate, the RMLVO config (evdev; applealu_iso; ara,gb; ,mac_intl) would result in the symbols: macintosh_vndr/apple(alukbd)+ara+macintosh_vndr/gb:2+gb(mac_intl):2 where `macintosh_vndr/gb:2` will be overriden by the following `gb(mac_intl):2`. This is unfortunate, but there does not seem to be a workaround for it. --- We would need to extend the rules syntax with a new wild card (e.g. ‘-’ or ‘∅’) to be able to match a missing variant, e.g.: ! model layout[2] variant[2] = symbols $applealu gb - = +macintosh_vndr/gb:2 $applealu gb * = +%l[2]%(v[2]):2 While at it, another wild card to match both present *and* missing variant would be really useful as well. Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/764>
2024-11-04Improve one-handed layouts descriptiontwo1-6/+6
Currently layouts designed to be used with only one hand have the English descriptions: “left handed” and “right handed”. This is ambiguous, as it highlights *handedness* rather than one-hand typing. Translations in some languages may thus convey only the former understanding, which is incorrect. Clarify that these layouts are for typing with only *one* hand. Closes #483 Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/737>
2024-10-04symbols/de: Add German (Noted) layoutBenjamin Drung1-0/+6
Add the newest layout of the German Neo keyboard layout family. Noted is a layout designed to make typing as comfortable and efficient as possible in both German and English. It was developed with the help of a layout optimizer, which is based on the metrics and concepts of ArneBab's optimizer and adapts and extends them. I switched from Neo 2 via Mine to Noted and I like to see this variant to be available out of the box in Debian/Ubuntu. Sources: * https://neo-layout.org/Layouts/noted/ * https://dariogoetz.github.io/noted-layout/
2024-09-21Update base.extras.xml, ruDenis Kaliberov1-0/+43
2024-09-05options: Added caps:returnPierre Le Marre1-0/+6
Added `caps:return` to make the `Caps Lock` key an additional `Return` key.
2024-08-27Fix NEC Japanese layout having two groupsPierre Le Marre3-3/+4
According to our doc and practices, symbols should be defined only for the first group. There are still a few layouts defining simultaneously two groups. One of them is `nec_vndr/jp`, which has also a dedicated rule. This commit fixes only this layout in preparation of a refactor for `inet` rules. - Split `nec_vndr/jp(pc98)` into two sections: `pc98` and `jp`, and make the latter the default section. - Fix the rules to ensure using this layout with the model `pc98` will load *explicitly* 2 layouts, as this is the case for other models. - Make the rules match `jp` layout, not `nec_vndr/jp`. No other rule used the vendor path to match a layout. The remaining layouts with 2 groups should also be fixed someday.
2024-08-26options: Added altwin:swap_ralt_rwinPierre Le Marre1-0/+6
This option swaps right `Alt` with right `Win`. Symbols are already there, so this commit just adds the corresponding rules via the registry. Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/731>
2024-08-23rules: Fix merging explicit and implicit merge modesPierre Le Marre1-3/+30
Since c4f76b584fe10bc2037966a70efad9bc5b682a4a we merge rule sets with and without explicit merge modes (i.e. *explicit* merge mode are section starting with either `+` or `|`). This is wrong, as these are not supposed to be matched at in the same rule set. Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/729>
2024-08-23rules: Fix duplicates created by the merge scriptPierre Le Marre1-4/+7
The previous update c4f76b584fe10bc2037966a70efad9bc5b682a4a removed the initialization of a dictionary in the `merge` function, leading to duplicates, namely the files *not* starting with a rule header. While we introduced `defaultdict` previously to avoid initializing lists manually, we still need to initialize the `dict` in order to keep it in sync with `section_names`. Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/729>
2024-08-23symbols/ru: Add Diktor extra layoutHloja Niželjska1-0/+10
Diktor is an ergonomic alternative to the JCUKEN layout (see: `ru(winkeys)`), adapting Dvorak design principles for Russian. Although it is popular, there is no track of the original author. The original implementation targeted Windows. The closest to an “official” web page is: https://olegp.name/software/diktor-keyboard-layout/.
2024-08-21rules: Fix layout compat rulesPierre Le Marre4-135/+195
Layout compatibility rules are broken in configurations with 2 or more layouts, e.g.: - Works: - config: `--layout fi --variant basic` - symbols: `pc+fi(classic)+inet(evdev)`. `fi(basic)` is correctly remapped to `fi(classic)`. - Does not work: - config `--layout fi,us --variant basic,` - symbols: `pc+fi(basic)+us:2+inet(evdev)`. `fi(basic)` is not remapped and leads to an include error. - Does not work: - config `--layout us,fi --variant ,basic` - symbols: `pc+us:fi(basic):2+fi(classic):2+inet(evdev)`. `fi(basic)` is not remapped and leads to an include error. I initially thought merging the following rules sets to fix it: 1. `model layout[n] = symbols` 2. `model layout[n] variant[n] = symbols` but it does not work: `*` wildcard does *not* match empty values. There is another issue: using a variant will check and match *both* rules sets. In the first rule set, compat rules are only for deleted symbols files (e.g. `dev`). But when the symbols file exists, we end up with an invalid include statement (see `fi(basic)` examples above). This is because the first rules set has a catch-all rule that will always match, while we want it to match only in the second rules set. Unfortunately such rules cannot be expressed in rules files. So the solution is to append generated compatibility sections in the corresponding symbols files and remove the corresponding current rules. Section name clashes are checked and will raise an error. E.g.: currently we append the following to `symbols/de`: partial xkb_symbols "lld" { include "it(lldde)" }; If we already had a section named lld, this would produce the following error: Cannot add compatibility section in symbols/de: "lld" already exists Also: - Move symbols handling in meson into the symbols subfolder. - Sort compat layout rules. - We ensure that rules with variant take priority over rules without one. Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/728>
2024-08-19rules: Improve merge scriptPierre Le Marre1-26/+45
- Merge section with same header, independently of the whitespaces. - Improve Python (typing) Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/728>
2024-08-19Add option to define F13-F24twistedturtle1-0/+12
2024-07-30Add option `caps:ctrl_shifted_capslock`Han-Miru Kim1-0/+6
Make `Caps Lock` an additional `Ctrl` and `Shift + Caps Lock` the regular `Caps Lock`. Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/673>
2024-07-30Add option lv3:caps_switch_capslock_with_ctrlHelfried Wiesinger1-0/+6
Use Caps Lock key as additional 3rd lever chooser, Ctrl + Caps Lock for original Caps Lock behaviour. The 2023 DIN standard for German keyboards recommends it as an option: - https://de.wikipedia.org/wiki/E1_(Tastaturbelegung)#Feststelltaste/Umschaltsperre - https://en.wikipedia.org/wiki/Caps_Lock#Abolition Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/687>
2024-07-19rules: Fix compat mappingsPierre Le Marre2-14/+24
Previously the compatibility rules where incorrect: - Lines with a comment starting by “//” where parsed incorrectly, because comments where in fact not supported. - `variantsMapping.lst` was added to rules without variant. This resulted in incorrect rules with MLVO = (model, layout), e.g. the beautiful following rules: ``` ! model layout = symbols * mao(nz(mao)) = pc+//(Delete) * ben(basic) = pc+in(ben) ``` Fixed the issue and ensure to raise an error if expectation on layout variant is broken.
2024-06-21Add caps:digits_row_independent_lock optionAlexandre Petit6-65/+76
`Shift + Caps` locks the digits on the digits row, `Caps Lock` alone behaves as usual (Azerty layouts). The `Shift + Caps Lock` combination inverts the first two levels only. Originally designed for layouts with digits on the second level of the digits row (e.g. Azerty layouts). This allows users to have direct access to digits while keeping usual capitalization via `Caps Lock`. Also add the `FOUR_LEVEL_LOCKABLE_LEVEL2` key type, a variant of `FOUR_LEVEL_MIXED_KEYPAD` that uses `LevelFive` instead of `NumLock`, to avoid interaction with the keypad. Originally created to lock the digits on layouts with digits on the second level of the digits row (e.g. Azerty layouts).
2024-06-13Require Python >=3.9 + optional strenum fallbackPierre Le Marre2-6/+17
Fallback with package `strenum` is required for Python < 3.11. Part-of: <https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/702>
2024-06-11rules: Check required Python versionPierre Le Marre1-0/+9
2024-06-10geometry: Revert dropping abnt2, jp106, kr106Pierre Le Marre2-1/+22
This partially reverts commits: - 91da938a16b4dc29df62fa3794d2d046daa2edbe - f67ca9fbb974c57cdef9d2c9f422d618e1c4de4c
2024-05-30Added Ergo‑L layout and variantNuclear Squid1-0/+12
Ergo‑L is an ergonomic keyboard layout meant to optimize the typing experience in French, English, and programming. Accents, diacritics and fancy typographic symbols are typed using a custom dead key, but it is fully implemented in the keymap itself as an `ISO_Level5_Latch.` Below is a more detailed presentation of the layout (in French): https://ergol.org/presentation/ This commit adds Ergo‑L `fr(ergol)`, along with an angle-mod variant `fr(ergol_iso)` made for ISO keyboards.
2024-05-30rules: minor improvement to generation scriptPierre Le Marre1-14/+16
2024-05-29Rules: fix generation script by not hard-coding rules exceptionsWismill2-115/+91
2024-05-29Add option scrolllock:mod3Peter Hutterer1-0/+6
This maps Scroll_Lock to Mod3, effectively enabling this virtual modifier.
2024-05-24rules: use symlinks to resolve mismatches between option names and filesPeter Hutterer1-2/+10
Use in-repository-only symlinks between symbols files that help us to resolve option mismatches, e.g. where we need to map caps:foo to capslock(foo). This effectively reverts symbols: symlink the special rules prefixes to our symbols files
2024-05-24rules: generate the option->{symbols,compat,types} mappings from our XML filesPeter Hutterer6-222/+323
The vast majority of options are a straightforward foo:bar = +foo(bar) mapping. Instead of maintaining those mappings by hand let's generate the rules file from the files we definitely maintain by hand: the base.xml (and base.extras.xml) files. This also makes it clearer which ones are exceptions and need to be filled in through other means (or ignored because the option does not affect any symbols). The resulting rules file is identical to the previous hand-generated one but it is alphabetically sorted and uses different whitespacing. For merge.py to work we need to also fix the whitespaces in rules/compat/0041-option_symbols.part, otherwise the duplicate header detection won't work.
2024-05-24rules: rename the .part files to be more explicitPeter Hutterer35-31/+31
This makes it immediately readable what maps to what over e.g. ml4_s.part.
2024-05-24compat: add some files to remove special casing in the rulesPeter Hutterer1-6/+6
2024-05-24symbols: add grab and srvrkeys with a single sectionPeter Hutterer1-2/+2
This avoids having to special-case grab:debug and srvrkeys:none in the rules files.
2024-05-24symbols: make a few sections independent of custom rulesPeter Hutterer1-3/+3
These used to have a special entry in the rules file - it's easier if we just make a section for them and have the rules-file entry map 1:1. For ctrl:grouptoggle_capscontrol see commit 6bba53fd
2024-04-19Added Old Hungarian layouts for users in SKKovács halomházi Viktor1-0/+14
On branch ohu_sk Changes to be committed: modified: rules/base.extras.xml modified: symbols/hu
2024-03-18Correcting "la" to "kab"ButterflyOfFire1-0/+1
2024-02-20Purge the old macs from our rulesPeter Hutterer8-41/+0
See the previous commits, none of these machines need the latest xkeyboard-config.
2024-02-20Purge the macbook 78/79 from our rulesPeter Hutterer3-16/+0
Best I can tell these are macbooks released from 2006 to 2012 or something. Doesn't matter too much anyway since the only effect of these rules was a different geometry file. Since geometry is not supported at all in libxkbcommon we won't lose much by dropping these special cases.