Commit graph qmk-firmware/lib/python/qmk/cli/generate
Author SHA1 Message Date
Nick Brassel
519bd5ac45
Keycode alias support. 2025-02-07 23:51:53 +11:00
Nick Brassel
dd2ea4aae0
Add introspection.h support and example. 2025-02-07 23:30:48 +11:00
Nick Brassel
3a5c075cf7
Add support for module-level introspection.c to be automatically injected. 2025-02-07 23:07:57 +11:00
Nick Brassel
e86d8d248f
Preprocessor consistency. 2025-02-06 16:49:33 +11:00
Nick Brassel
ad90132710
Subdirs and relative pathing. 2025-02-05 21:26:59 +11:00
Nick Brassel
520b5bf980
Merge remote-tracking branch 'upstream/develop' into community-modules 2025-02-05 20:40:33 +11:00
Ryan
273d8d6a1a
qmk docs: restore --port and --browser arguments (#24623)
* `qmk docs`: restore `--port` and `--browser` arguments

* Make docs command args always a list
2025-02-01 21:19:30 +11:00
Pascal Getreuer
544ddde113
[Core] Add Chordal Hold, an "opposite hands rule" tap-hold option similar to Achordion, Bilateral Combinations. (#24560)
* Chordal Hold: restrict what chords settle as hold

* Chordal Hold: docs and further improvements

* Fix formatting.

* Doc rewording and minor edit.

* Support Chordal Hold of multiple tap-hold keys.

* Fix formatting.

* Simplification and additional test.

* Fix formatting.

* Tighten tests.

* Add test two_mod_taps_same_hand_hold_til_timeout.

* Revise handing of pairs of tap-hold keys.

* Generate a default chordal_hold_layout.

* Document chordal_hold_handedness().

* Add license notice to new and branched files in PR.

* Add `tapping.chordal_hold` property for info.json.

* Update docs/reference_info_json.md

* Revise "hand" jsonschema.

* Chordal Hold: Improved layout handedness heuristic.

This commit improves the heuristic used in generate-keyboard-c for
inferring key handedness from keyboard.json geometry data.

Heuristic summary:

1. If the layout is symmetric (e.g. most split keyboards), guess the
   handedness based on the sign of (x - layout_x_midpoint).

2. Otherwise, if the layout has a key of >=6u width, it is probably the
   spacebar. Form a dividing line through the spacebar, nearly vertical
   but with a slight angle to follow typical row stagger.

3. Otherwise, assume handedness based on the widest horizontal
   separation.

I have tested this strategy on a couple dozen keyboards and found it to
work reliably.

* Use Optional instead of `| None`.

* Refactor to avoid lambdas.

* Remove trailing comma in chordal_hold_layout.

* Minor docs edits.

* Revise to allow combining multiple same-hand mods.

This commit revises Chordal Hold as described in discussion in
https://github.com/qmk/qmk_firmware/pull/24560#discussion_r1894655238

1. In "RCTL_T(KC_A)↓, RSFT_T(KC_C)↓, RCTL_T(KC_A)↑" before the tapping
   term, RCTL_T(KC_A) is settled as tapped.
2. In "RCTL_T(KC_A)↓, RSFT_T(KC_C)↓, RSFT_T(KC_C)↑", both RCTL_T(KC_A)
   and RSFT_T(KC_C) are settled as tapped.
3. In "RCTL_T(KC_A)↓, RSFT_T(KC_C)↓, KC_U↓" (all keys on the same side),
   both RCTL_T(KC_A) and RSFT_T(KC_C) are settled as tapped.
4. In "RCTL_T(KC_A)↓, RSFT_T(KC_C)↓, LSFT_T(KC_T)↓", with the third key
   on the other side, we allow Permissive Hold or Hold On Other Keypress
   to decide how/when to settle the keys.
5. In "RCTL_T(KC_A)↓, RSFT_T(KC_C)↓" held until the tapping term, the
   keys are settled as held.

1–3 provide same-hand roll protection. 4–5 are for combining multiple
same-hand modifiers.

I've updated the unit tests and have been running it on my keyboard, for
a few hours so far, and all seems good. I really like this scheme. It
allows combining same-side mods, yet it also has roll protection on
streaks. For me, this feels like Achordion, but clearly better streak
handling and improved responsiveness.

* Fix formatting.

* Add a couple tests with LT keys.

* Remove stale use of CHORDAL_HOLD_LAYOUT.

* Fix misspelling lastest -> latest

* Handling tweak for LTs and tests.

* Fix formatting.

* More tests with LT keys.

* Fix formatting.
2025-01-27 12:32:23 +01:00
Nick Brassel
8b47562c5d
Userspace modules. 2025-01-24 22:57:54 +11:00
Nick Brassel
c6454b5585
Add support for features object. 2025-01-24 21:42:33 +11:00
Nick Brassel
1c4c6ae280
Appease the gods of formatting. 2025-01-24 09:26:14 +11:00
Nick Brassel
1354424fd7
First stab at keycodes. 2025-01-24 09:22:49 +11:00
Nick Brassel
54673745a6
nitpicks 2025-01-24 01:17:16 +11:00
Nick Brassel
c9ee24ba86
keyboard and keymap modules 2025-01-24 01:11:45 +11:00
Nick Brassel
d4733cc574
user/kb module hooks. 2025-01-23 23:21:07 +11:00
Nick Brassel
fe3eac28ba
Preprocessor guards, OS detection hooks. 2025-01-22 17:00:06 +11:00
Nick Brassel
5a70aecb6b
Suspend callbacks. 2025-01-22 14:19:56 +11:00
Nick Brassel
8f79ed1f23
More APIs added, versioning. 2025-01-22 14:13:20 +11:00
Nick Brassel
11b9ff0c4f
Appease the gods of formatting. 2025-01-22 00:59:50 +11:00
Nick Brassel
e3fe9fac60
First stab at codegen. 2025-01-22 00:50:55 +11:00
Ryan
0f3993b9a3
default_keyboard.h generation tweaks (#24715) 2024-12-15 19:06:05 +00:00
Ryan
bc0c69570b
Rename encoder pins defines (#24003) 2024-07-03 17:18:27 +10:00
Joel Challis
53a0cdc446
Implement data driven joysticks (#22947) 2024-06-18 03:44:22 +01:00
Joel Challis
938badc3b0
Generate keymap dd keycodes to header (#20273) 2024-06-17 21:51:53 +01:00
Nick Brassel
0262161914
[CLI] Don't exit() when certain exceptions occur. (#23442) 2024-06-15 10:37:47 +01:00
Nick Brassel
6ef9717288
Vitepress conversion of docs. (#23795) 2024-05-30 12:00:41 +10:00
Nick Brassel
ac80cee9da
Merge remote-tracking branch 'upstream/master' into develop 2024-05-02 20:32:16 +10:00
Nick Brassel
9a4f39b738
clangd enhancements. (#23310) 2024-05-02 20:08:41 +10:00
Joel Challis
9f4a9d5826
Enable 'keyboard.json' as a build target (#22891) 2024-03-10 16:20:25 +11:00
Nick Brassel
56802f506c
Ensure qmk generate-compilation-database copies to userspace as well. (#23129) 2024-02-22 12:47:42 +00:00
QMK Bot
2655ce58f9 Merge remote-tracking branch 'origin/master' into develop 2024-01-22 11:36:23 +00:00
Joel Challis
58721a433b
Move layout macro OOB checks to lint (#22610) 2024-01-22 11:35:51 +00:00
Ryan
1bebaa310a
CLI: Allow generation of both LED and RGB Matrix config (#22896) 2024-01-14 10:33:58 +00:00
Joel Challis
71257e21e6
Generate true/false for _DEFAULT_ON options (#22829) 2024-01-06 13:16:23 +00:00
Sergey Vlasov
958215e9d6
Fix more qmk generate-api fallout from userspace support (#22619) 2023-12-06 17:59:42 +11:00
Ryan
f1043e3a92
Fix JSON keymap URLs generated by the API (#22618) 2023-12-06 15:55:35 +11:00
Joel Challis
bba5c14933
Avoid exceptions when layouts contain OOB matrix values (#22609) 2023-12-05 13:32:07 +00:00
Nick Brassel
46b996a55e
CLI parallel search updates (#22525) 2023-11-22 11:14:34 +11:00
Nick Brassel
4938210711
CLI refactoring for common build target APIs (#22221) 2023-11-15 16:24:54 +11:00
Joel Challis
b31426252e
Generate switch statement helpers for keycode ranges (#20059) 2023-11-01 13:11:42 +11:00
Joel Challis
fbbb221a31
Implement data driven lighting defaults (#21825) 2023-11-01 01:26:24 +00:00
Joel Challis
a19ae3d784
Add dd mapping for hardware based split handedness (#22369) 2023-11-01 00:55:48 +00:00
Joel Challis
17c3182b1c
Remove use of broken split.main (#22363) 2023-10-30 00:49:56 +00:00
Joel Challis
559450a099
Fix 'to_c' for config.h mappings (#22364) 2023-10-29 23:41:44 +00:00
Joel Challis
98530cad3b
Implement data driven dip switches (#22017)
* Add data driven dip switches

* Autogen weak matrix_mask
2023-10-29 01:09:02 +01:00
QMK Bot
f4677c866e Merge remote-tracking branch 'origin/master' into develop 2023-09-28 10:49:40 +00:00
Nick Brassel
fb0c64a567
Allow inline generation of compile_commands.json while doing a qmk compile, using --compiledb (#21549) 2023-09-28 11:48:58 +01:00
Joel Challis
de381ad3b7
Generate keymap.json config options more forcefully (#21960) 2023-09-13 01:12:46 +01:00
Ryan
f407d90598
keycode aliases: work around ChibiOS ch.h include guard (#21497) 2023-07-31 09:35:06 +10:00
Ryan
030511ece3
CLI: Improve error messages when layout key matrix row/col is OOB (#21640) 2023-07-31 09:34:19 +10:00