summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Le Marre <dev@wismill.eu>2024-02-17 09:27:02 +0100
committerSergey Udaltsov <sergey.udaltsov@gmail.com>2024-02-19 11:04:09 +0000
commit90acac43af5be3d958ecc5ddfbdc62ed08ea2b2f (patch)
tree8bdf8e5a4e1cd12e8e5c364608e4c708f3785c1b
parent82cfdf15b547b8d6f5b4c76b0d8678141c7ef382 (diff)
Add caps:digits_row option for Azerty layouts
The Azerty keyboards used in France and Belgium have the digits on the shift level instead of on the base level of the top row. In Windows the corresponding layouts have the curious characteristic that CapsLock locks also the digits, meaning that some users have acquired the habit of engaging CapsLock when they need to type some digits. Fix this by adding a new option `caps:digits_row` that applies only to the `$azerty` layouts group (currently `fr` and `be`). This option changes the key type of the digits keys to `FOUR_LEVEL_SEMIALPHABETIC`. There are two drawbacks with this solution: - It is not possible to type the uppercase À, È, É and Ç. Without the option, one gets those by the internal transformation rules, done either by the X server or xkbcommon. - It changes the behavior of the US variants from `fr`. But we do not expect anyone to use at the same time e.g. `fr` and `fr(us-alt)` with the new option `caps:number_row`. Instead we expect e.g. either one uses `fr(us-alt)` alone or `fr,us`. In the former case the option is not needed, while in the later case the option works correctly.
-rw-r--r--rules/0036-lo_s.part1
-rw-r--r--rules/0037-l1o_s.part1
-rw-r--r--rules/0038-l2o_s.part1
-rw-r--r--rules/0039-l3o_s.part1
-rw-r--r--rules/0040-l4o_s.part1
-rw-r--r--rules/base.xml6
-rw-r--r--symbols/capslock22
7 files changed, 33 insertions, 0 deletions
diff --git a/rules/0036-lo_s.part b/rules/0036-lo_s.part
index a3c6ca6b..73aa02ab 100644
--- a/rules/0036-lo_s.part
+++ b/rules/0036-lo_s.part
@@ -10,3 +10,4 @@
* grp:ctrl_space_toggle = +group(ctrl_space_toggle)
* grp:rctrl_rshift_toggle = +group(rctrl_rshift_toggle)
* grp:shifts_toggle = +group(shifts_toggle)
+ $azerty caps:digits_row = +capslock(digits_row)
diff --git a/rules/0037-l1o_s.part b/rules/0037-l1o_s.part
index 32c0939d..376d90f0 100644
--- a/rules/0037-l1o_s.part
+++ b/rules/0037-l1o_s.part
@@ -10,3 +10,4 @@
* grp:ctrl_space_toggle = +group(ctrl_space_toggle):1
* grp:rctrl_rshift_toggle = +group(rctrl_rshift_toggle):1
* grp:shifts_toggle = +group(shifts_toggle):1
+ $azerty caps:digits_row = +capslock(digits_row):1
diff --git a/rules/0038-l2o_s.part b/rules/0038-l2o_s.part
index 3c0482ca..7eeee13a 100644
--- a/rules/0038-l2o_s.part
+++ b/rules/0038-l2o_s.part
@@ -10,3 +10,4 @@
* grp:ctrl_space_toggle = +group(ctrl_space_toggle):2
* grp:rctrl_rshift_toggle = +group(rctrl_rshift_toggle):2
* grp:shifts_toggle = +group(shifts_toggle):2
+ $azerty caps:digits_row = +capslock(digits_row):2
diff --git a/rules/0039-l3o_s.part b/rules/0039-l3o_s.part
index e1d0fe14..17c2163f 100644
--- a/rules/0039-l3o_s.part
+++ b/rules/0039-l3o_s.part
@@ -10,3 +10,4 @@
* grp:ctrl_space_toggle = +group(ctrl_space_toggle):3
* grp:rctrl_rshift_toggle = +group(rctrl_rshift_toggle):3
* grp:shifts_toggle = +group(shifts_toggle):3
+ $azerty caps:digits_row = +capslock(digits_row):3
diff --git a/rules/0040-l4o_s.part b/rules/0040-l4o_s.part
index 07ce633d..0bad6897 100644
--- a/rules/0040-l4o_s.part
+++ b/rules/0040-l4o_s.part
@@ -10,3 +10,4 @@
* grp:ctrl_space_toggle = +group(ctrl_space_toggle):4
* grp:rctrl_rshift_toggle = +group(rctrl_rshift_toggle):4
* grp:shifts_toggle = +group(shifts_toggle):4
+ $azerty caps:digits_row = +capslock(digits_row):4
diff --git a/rules/base.xml b/rules/base.xml
index e1ea61de..23d31353 100644
--- a/rules/base.xml
+++ b/rules/base.xml
@@ -7663,6 +7663,12 @@
</option>
<option>
<configItem>
+ <name>caps:digits_row</name>
+ <description>Caps Lock gives digits on the digits row (Azerty layouts)</description>
+ </configItem>
+ </option>
+ <option>
+ <configItem>
<name>caps:none</name>
<description>Caps Lock is disabled</description>
</configItem>
diff --git a/symbols/capslock b/symbols/capslock
index 11d279a3..98ea29c2 100644
--- a/symbols/capslock
+++ b/symbols/capslock
@@ -84,3 +84,25 @@ hidden partial modifier_keys
xkb_symbols "none" {
key <CAPS> { [ VoidSymbol ], type[group1] = "ONE_LEVEL" };
};
+
+// For layouts having digits on the 2nd level on the digits row and key type
+// FOUR_LEVEL (e.g. fr(basic) and be(basic)), this makes CapsLock give the digits
+// by changing their key type to FOUR_LEVEL_SEMIALPHABETIC. Note that this has the
+// drawback that the uppercases À, È, É and Ç are no longer available, as those
+// layouts rely on internal capitalization rules for those letters.
+hidden partial alphanumeric_keys
+xkb_symbols "digits_row" {
+ key.type[group1] = "FOUR_LEVEL_SEMIALPHABETIC";
+
+ // No symbol defined: we just want to change the key type
+ key <AE01> { [ NoSymbol, NoSymbol, NoSymbol, NoSymbol ] };
+ key <AE02> { [ NoSymbol, NoSymbol, NoSymbol, NoSymbol ] };
+ key <AE03> { [ NoSymbol, NoSymbol, NoSymbol, NoSymbol ] };
+ key <AE04> { [ NoSymbol, NoSymbol, NoSymbol, NoSymbol ] };
+ key <AE05> { [ NoSymbol, NoSymbol, NoSymbol, NoSymbol ] };
+ key <AE06> { [ NoSymbol, NoSymbol, NoSymbol, NoSymbol ] };
+ key <AE07> { [ NoSymbol, NoSymbol, NoSymbol, NoSymbol ] };
+ key <AE08> { [ NoSymbol, NoSymbol, NoSymbol, NoSymbol ] };
+ key <AE09> { [ NoSymbol, NoSymbol, NoSymbol, NoSymbol ] };
+ key <AE10> { [ NoSymbol, NoSymbol, NoSymbol, NoSymbol ] };
+};