summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2025-05-14 13:02:43 +0100
committerGitHub <noreply@github.com>2025-05-14 22:02:43 +1000
commit05ff5443b1d528855332b4b06063fad26f21e391 (patch)
tree5f022267b25c5e8e8fade9ecddf906e362ff097c
parente553cf7214e3f608ede138a6133aaf4d2fecdac7 (diff)
Deprecate `usb.force_nkro`/`FORCE_NKRO` (#25262)
-rw-r--r--data/mappings/info_config.hjson5
-rw-r--r--data/schemas/keyboard.jsonschema18
-rw-r--r--docs/config_options.md2
-rw-r--r--docs/features/stenography.md2
-rw-r--r--docs/reference_info_json.md11
-rw-r--r--quantum/eeconfig.c6
-rw-r--r--quantum/keyboard.c1
7 files changed, 36 insertions, 9 deletions
diff --git a/data/mappings/info_config.hjson b/data/mappings/info_config.hjson
index bab881583a..e4def1a4d7 100644
--- a/data/mappings/info_config.hjson
+++ b/data/mappings/info_config.hjson
@@ -64,6 +64,9 @@
64 "WEAR_LEVELING_BACKING_SIZE": {"info_key": "eeprom.wear_leveling.backing_size", "value_type": "int", "to_json": false}, 64 "WEAR_LEVELING_BACKING_SIZE": {"info_key": "eeprom.wear_leveling.backing_size", "value_type": "int", "to_json": false},
65 "WEAR_LEVELING_LOGICAL_SIZE": {"info_key": "eeprom.wear_leveling.logical_size", "value_type": "int", "to_json": false}, 65 "WEAR_LEVELING_LOGICAL_SIZE": {"info_key": "eeprom.wear_leveling.logical_size", "value_type": "int", "to_json": false},
66 66
67 // host
68 "NKRO_DEFAULT_ON": {"info_key": "host.default.nkro", "value_type": "bool"},
69
67 // Layer locking 70 // Layer locking
68 "LAYER_LOCK_IDLE_TIMEOUT": {"info_key": "layer_lock.timeout", "value_type": "int"}, 71 "LAYER_LOCK_IDLE_TIMEOUT": {"info_key": "layer_lock.timeout", "value_type": "int"},
69 72
@@ -215,7 +218,6 @@
215 "TAPPING_TOGGLE": {"info_key": "tapping.toggle", "value_type": "int"}, 218 "TAPPING_TOGGLE": {"info_key": "tapping.toggle", "value_type": "int"},
216 219
217 // USB 220 // USB
218 "FORCE_NKRO": {"info_key": "usb.force_nkro", "value_type": "flag"},
219 "USB_MAX_POWER_CONSUMPTION": {"info_key": "usb.max_power", "value_type": "int"}, 221 "USB_MAX_POWER_CONSUMPTION": {"info_key": "usb.max_power", "value_type": "int"},
220 "USB_POLLING_INTERVAL_MS": {"info_key": "usb.polling_interval", "value_type": "int"}, 222 "USB_POLLING_INTERVAL_MS": {"info_key": "usb.polling_interval", "value_type": "int"},
221 "USB_SUSPEND_WAKEUP_DELAY": {"info_key": "usb.suspend_wakeup_delay", "value_type": "int"}, 223 "USB_SUSPEND_WAKEUP_DELAY": {"info_key": "usb.suspend_wakeup_delay", "value_type": "int"},
@@ -253,6 +255,7 @@
253 "PRODUCT": {"info_key": "keyboard_name", "warn_duplicate": false, "value_type": "str", "deprecated": true, "replace_with": "`keyboard_name` in info.json"}, 255 "PRODUCT": {"info_key": "keyboard_name", "warn_duplicate": false, "value_type": "str", "deprecated": true, "replace_with": "`keyboard_name` in info.json"},
254 "PRODUCT_ID": {"info_key": "usb.pid", "value_type": "hex", "deprecated": true, "replace_with": "`usb.pid` in info.json"}, 256 "PRODUCT_ID": {"info_key": "usb.pid", "value_type": "hex", "deprecated": true, "replace_with": "`usb.pid` in info.json"},
255 "VENDOR_ID": {"info_key": "usb.vid", "value_type": "hex", "deprecated": true, "replace_with": "`usb.vid` in info.json"}, 257 "VENDOR_ID": {"info_key": "usb.vid", "value_type": "hex", "deprecated": true, "replace_with": "`usb.vid` in info.json"},
258 "FORCE_NKRO": {"info_key": "usb.force_nkro", "value_type": "flag", "deprecated": true, "replace_with": "`host.default.nkro` in info.json"},
256 259
257 // Items we want flagged in lint 260 // Items we want flagged in lint
258 "VIAL_KEYBOARD_UID": {"info_key": "_invalid.vial_uid", "invalid": true}, 261 "VIAL_KEYBOARD_UID": {"info_key": "_invalid.vial_uid", "invalid": true},
diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema
index 4e8bae1084..c22b0ff0da 100644
--- a/data/schemas/keyboard.jsonschema
+++ b/data/schemas/keyboard.jsonschema
@@ -443,6 +443,18 @@
443 } 443 }
444 } 444 }
445 }, 445 },
446 "host": {
447 "type": "object",
448 "properties": {
449 "default": {
450 "type": "object",
451 "additionalProperties": false,
452 "properties": {
453 "nkro": {"type": "boolean"}
454 }
455 }
456 }
457 },
446 "leader_key": { 458 "leader_key": {
447 "type": "object", 459 "type": "object",
448 "properties": { 460 "properties": {
@@ -952,7 +964,11 @@
952 "$comment": "Deprecated: use device_version instead" 964 "$comment": "Deprecated: use device_version instead"
953 }, 965 },
954 "device_version": {"$ref": "qmk.definitions.v1#/bcd_version"}, 966 "device_version": {"$ref": "qmk.definitions.v1#/bcd_version"},
955 "force_nkro": {"type": "boolean"}, 967 "force_nkro": {
968 "type": "boolean",
969 "$comment": "Deprecated: use host.default.nkro instead"
970
971 },
956 "pid": {"$ref": "qmk.definitions.v1#/hex_number_4d"}, 972 "pid": {"$ref": "qmk.definitions.v1#/hex_number_4d"},
957 "vid": {"$ref": "qmk.definitions.v1#/hex_number_4d"}, 973 "vid": {"$ref": "qmk.definitions.v1#/hex_number_4d"},
958 "max_power": {"$ref": "qmk.definitions.v1#/unsigned_int"}, 974 "max_power": {"$ref": "qmk.definitions.v1#/unsigned_int"},
diff --git a/docs/config_options.md b/docs/config_options.md
index e75a5b2f7e..b2a2117693 100644
--- a/docs/config_options.md
+++ b/docs/config_options.md
@@ -140,8 +140,6 @@ If you define these options you will enable the associated feature, which may in
140 140
141* `#define ENABLE_COMPILE_KEYCODE` 141* `#define ENABLE_COMPILE_KEYCODE`
142 * Enables the `QK_MAKE` keycode 142 * Enables the `QK_MAKE` keycode
143* `#define FORCE_NKRO`
144 * NKRO by default requires to be turned on, this forces it on during keyboard startup regardless of EEPROM setting. NKRO can still be turned off but will be turned on again if the keyboard reboots.
145* `#define STRICT_LAYER_RELEASE` 143* `#define STRICT_LAYER_RELEASE`
146 * force a key release to be evaluated using the current layer stack instead of remembering which layer it came from (used for advanced cases) 144 * force a key release to be evaluated using the current layer stack instead of remembering which layer it came from (used for advanced cases)
147 145
diff --git a/docs/features/stenography.md b/docs/features/stenography.md
index c6c2155a9a..7fd245d59a 100644
--- a/docs/features/stenography.md
+++ b/docs/features/stenography.md
@@ -8,7 +8,7 @@ The [Open Steno Project](https://www.openstenoproject.org/) has built an open-so
8 8
9Plover can work with any standard QWERTY keyboard, although it is more efficient if the keyboard supports NKRO (n-key rollover) to allow Plover to see all the pressed keys at once. An example keymap for Plover can be found in `planck/keymaps/default`. Switching to the `PLOVER` layer adjusts the position of the keyboard to support the number bar. 9Plover can work with any standard QWERTY keyboard, although it is more efficient if the keyboard supports NKRO (n-key rollover) to allow Plover to see all the pressed keys at once. An example keymap for Plover can be found in `planck/keymaps/default`. Switching to the `PLOVER` layer adjusts the position of the keyboard to support the number bar.
10 10
11To enable NKRO, add `NKRO_ENABLE = yes` in your `rules.mk` and make sure to press `NK_ON` to turn it on because `NKRO_ENABLE = yes` merely adds the possibility of switching to NKRO mode but it doesn't automatically switch to it. If you want to automatically switch, add `#define FORCE_NKRO` in your `config.h`. 11To enable NKRO, add `NKRO_ENABLE = yes` in your `rules.mk` and make sure to press `NK_ON` to turn it on because `NKRO_ENABLE = yes` merely adds the possibility of switching to NKRO mode but it doesn't automatically switch to it. If you want to automatically switch, add `#define NKRO_DEFAULT_ON true` in your `config.h`.
12 12
13You may also need to adjust your layout, either in QMK or in Plover, if you have anything other than a standard layout. You may also want to purchase some steno-friendly keycaps to make it easier to hit multiple keys. 13You may also need to adjust your layout, either in QMK or in Plover, if you have anything other than a standard layout. You may also want to purchase some steno-friendly keycaps to make it easier to hit multiple keys.
14 14
diff --git a/docs/reference_info_json.md b/docs/reference_info_json.md
index 0f8f680b55..a64f2992b5 100644
--- a/docs/reference_info_json.md
+++ b/docs/reference_info_json.md
@@ -274,6 +274,14 @@ Configures the [Encoder](features/encoders) feature.
274 * The number of edge transitions on both pins required to register an input. 274 * The number of edge transitions on both pins required to register an input.
275 * Default: `4` 275 * Default: `4`
276 276
277## Host {#host}
278
279* `host`
280 * `default`
281 * `nkro` <Badge type="info">Boolean</Badge>
282 * The default nkro state.
283 * Default: `false`
284
277## Indicators {#indicators} 285## Indicators {#indicators}
278 286
279Configures the [LED Indicators](features/led_indicators) feature. 287Configures the [LED Indicators](features/led_indicators) feature.
@@ -818,9 +826,6 @@ Configures the [Stenography](features/stenography) feature.
818 * `vid` <Badge type="info">String</Badge> <Badge>Required</Badge> 826 * `vid` <Badge type="info">String</Badge> <Badge>Required</Badge>
819 * The USB vendor ID as a four-digit hexadecimal number. 827 * The USB vendor ID as a four-digit hexadecimal number.
820 * Example: `"0xC1ED"` 828 * Example: `"0xC1ED"`
821 * `force_nkro` <Badge type="info">Boolean</Badge>
822 * Force NKRO to be active.
823 * Default: `false`
824 * `max_power` <Badge type="info">Number</Badge> 829 * `max_power` <Badge type="info">Number</Badge>
825 * The maximum current draw the host should expect from the device. This does not control the actual current usage. 830 * The maximum current draw the host should expect from the device. This does not control the actual current usage.
826 * Default: `500` (500 mA) 831 * Default: `500` (500 mA)
diff --git a/quantum/eeconfig.c b/quantum/eeconfig.c
index 1e8cfd758a..f14e6ddf97 100644
--- a/quantum/eeconfig.c
+++ b/quantum/eeconfig.c
@@ -47,6 +47,10 @@ void eeconfig_init_via(void);
47void dynamic_keymap_reset(void); 47void dynamic_keymap_reset(void);
48#endif // VIA_ENABLE 48#endif // VIA_ENABLE
49 49
50#ifndef NKRO_DEFAULT_ON
51# define NKRO_DEFAULT_ON false
52#endif
53
50__attribute__((weak)) void eeconfig_init_user(void) { 54__attribute__((weak)) void eeconfig_init_user(void) {
51#if (EECONFIG_USER_DATA_SIZE) == 0 55#if (EECONFIG_USER_DATA_SIZE) == 0
52 // Reset user EEPROM value to blank, rather than to a set value 56 // Reset user EEPROM value to blank, rather than to a set value
@@ -82,7 +86,7 @@ void eeconfig_init_quantum(void) {
82 .no_gui = false, 86 .no_gui = false,
83 .swap_grave_esc = false, 87 .swap_grave_esc = false,
84 .swap_backslash_backspace = false, 88 .swap_backslash_backspace = false,
85 .nkro = false, 89 .nkro = NKRO_DEFAULT_ON,
86 .swap_lctl_lgui = false, 90 .swap_lctl_lgui = false,
87 .swap_rctl_rgui = false, 91 .swap_rctl_rgui = false,
88 .oneshot_enable = true, // Enable oneshot by default 92 .oneshot_enable = true, // Enable oneshot by default
diff --git a/quantum/keyboard.c b/quantum/keyboard.c
index be51190a87..c1a6d444a5 100644
--- a/quantum/keyboard.c
+++ b/quantum/keyboard.c
@@ -509,6 +509,7 @@ void keyboard_init(void) {
509 steno_init(); 509 steno_init();
510#endif 510#endif
511#if defined(NKRO_ENABLE) && defined(FORCE_NKRO) 511#if defined(NKRO_ENABLE) && defined(FORCE_NKRO)
512# pragma message "FORCE_NKRO option is now deprecated - Please migrate to NKRO_DEFAULT_ON instead."
512 keymap_config.nkro = 1; 513 keymap_config.nkro = 1;
513 eeconfig_update_keymap(&keymap_config); 514 eeconfig_update_keymap(&keymap_config);
514#endif 515#endif