From 23b188330f53c3907802efb091614002ee4237b7 Mon Sep 17 00:00:00 2001 From: Derek Date: Sat, 15 Aug 2020 19:30:35 -0400 Subject: Update setup.sh Updated setup.sh --- docs/static/setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/static/setup.sh b/docs/static/setup.sh index 27dcb0b..71692ef 100644 --- a/docs/static/setup.sh +++ b/docs/static/setup.sh @@ -11,7 +11,7 @@ title="ZMK Config Setup:" # TODO: Check for user.name and user.email git configs being set prompt="Pick an MCU board:" -options=("nice!nano" "QMK Proton-C") +options=("nice!nano" "QMK Proton-C" "bluemicro52840_v1") echo "$title" echo "" @@ -37,7 +37,7 @@ echo "" echo "Keyboard Shield Selection:" prompt="Pick an keyboard:" -options=("Kyria" "Lily58" "Corne") +options=("Kyria" "Lily58" "Corne" "splitreus62") PS3="$prompt " # TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos. -- cgit v1.3.1 From ba1cde94a80e7ecaf8e2a8373b08eb65ef820285 Mon Sep 17 00:00:00 2001 From: Derek Date: Sun, 16 Aug 2020 08:43:09 -0400 Subject: Update docs/static/setup.sh Co-authored-by: Pete Johanson --- docs/static/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/static/setup.sh b/docs/static/setup.sh index 71692ef..0717889 100644 --- a/docs/static/setup.sh +++ b/docs/static/setup.sh @@ -11,7 +11,7 @@ title="ZMK Config Setup:" # TODO: Check for user.name and user.email git configs being set prompt="Pick an MCU board:" -options=("nice!nano" "QMK Proton-C" "bluemicro52840_v1") +options=("nice!nano" "QMK Proton-C" "BlueMicro52840 (v1)") echo "$title" echo "" -- cgit v1.3.1 From 68da92f4ddb9fab9bc5cc92c96b50578f7b66266 Mon Sep 17 00:00:00 2001 From: Derek Date: Sun, 16 Aug 2020 08:45:03 -0400 Subject: Update setup.sh --- docs/static/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/static/setup.sh b/docs/static/setup.sh index 71692ef..ca223a8 100644 --- a/docs/static/setup.sh +++ b/docs/static/setup.sh @@ -37,7 +37,7 @@ echo "" echo "Keyboard Shield Selection:" prompt="Pick an keyboard:" -options=("Kyria" "Lily58" "Corne" "splitreus62") +options=("Kyria" "Lily58" "Corne") PS3="$prompt " # TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos. -- cgit v1.3.1 From 17c43881b8441e3e5c2fe9b5d25cb5ee9536a26a Mon Sep 17 00:00:00 2001 From: Derek Date: Sun, 16 Aug 2020 13:43:59 -0400 Subject: Updated select block --- docs/static/setup.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/static/setup.sh b/docs/static/setup.sh index c4a4f61..72eee0b 100644 --- a/docs/static/setup.sh +++ b/docs/static/setup.sh @@ -23,6 +23,7 @@ select opt in "${options[@]}" "Quit"; do 1 ) board="nice_nano"; break;; 2 ) board="proton_c"; break;; + 3 ) board="BlueMicro52840 (v1)"; break;; $(( ${#options[@]}+1 )) ) echo "Goodbye!"; exit;; *) echo "Invalid option. Try another one.";continue;; -- cgit v1.3.1 From abe40f8ef52265f9d807775a82f40ca783622018 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Sun, 16 Aug 2020 21:30:45 -0400 Subject: Various fixes. --- app/boards/arm/bluemicro52840_v1/Kconfig.defconfig | 2 +- app/boards/arm/bluemicro52840_v1/board.cmake | 4 ++-- docs/static/setup.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/app/boards/arm/bluemicro52840_v1/Kconfig.defconfig b/app/boards/arm/bluemicro52840_v1/Kconfig.defconfig index e33a655..90a5ed9 100644 --- a/app/boards/arm/bluemicro52840_v1/Kconfig.defconfig +++ b/app/boards/arm/bluemicro52840_v1/Kconfig.defconfig @@ -1,4 +1,4 @@ -# Electronut Labs Papyr board configuration +# BlueMicro52840 board configuration # Copyright (c) 2020 Pete Johanson, Derek Schmell # SPDX-License-Identifier: MIT diff --git a/app/boards/arm/bluemicro52840_v1/board.cmake b/app/boards/arm/bluemicro52840_v1/board.cmake index c0eed65..fa847d5 100644 --- a/app/boards/arm/bluemicro52840_v1/board.cmake +++ b/app/boards/arm/bluemicro52840_v1/board.cmake @@ -1,5 +1,5 @@ - #SPDX-License-Identifier: MIT - +# SPDX-License-Identifier: MIT + board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset") include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) diff --git a/docs/static/setup.sh b/docs/static/setup.sh index 72eee0b..55c96ff 100644 --- a/docs/static/setup.sh +++ b/docs/static/setup.sh @@ -23,7 +23,7 @@ select opt in "${options[@]}" "Quit"; do 1 ) board="nice_nano"; break;; 2 ) board="proton_c"; break;; - 3 ) board="BlueMicro52840 (v1)"; break;; + 3 ) board="bluemicro52840_v1"; break;; $(( ${#options[@]}+1 )) ) echo "Goodbye!"; exit;; *) echo "Invalid option. Try another one.";continue;; -- cgit v1.3.1 From 1607656c531f315f7d9209f576a2e0784b8e0d75 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Sun, 16 Aug 2020 23:16:50 -0400 Subject: Note the fixed showstoppers. --- docs/blog/2020-08-12-zmk-sotf-1.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/blog/2020-08-12-zmk-sotf-1.md b/docs/blog/2020-08-12-zmk-sotf-1.md index 2b69535..8a3ca7c 100644 --- a/docs/blog/2020-08-12-zmk-sotf-1.md +++ b/docs/blog/2020-08-12-zmk-sotf-1.md @@ -28,10 +28,10 @@ There's been lots of various activity in ZMK land! Despite the flurry of activity, there are still some serious bugs and show stoppers that potential ZMK users should be aware of: - [Bluetooth Related](https://github.com/zmkfirmware/zmk/issues/58) - There are several key bugs and fixes needed, including one complete show stopper: - - Fully working split wireless is not working. In particular, both split halves can properly pair, but once they do so, pairing with the _central_ host will not work. Workaround: You can currently have both halves pair, and use USB on the central side (Left side right now for Kyria, Corne, Lily58) and receive HID events over USB. + - Fully working split wireless is not working. In particular, both split halves can properly pair, but once they do so, pairing with the _central_ host will not work. Workaround: You can currently have both halves pair, and use USB on the central side (Left side right now for Kyria, Corne, Lily58) and receive HID events over USB. - Fixed in 8b61beb. - BT bond information is not currently stored to the devices, so after powering off or restarting your device, users need to re-pair - USB - There is one important USB related bug which is a showstopper: - - The Zephyr USB stack does not have a built in queue for endpoint data being written. As a result, HID events sent by ZMK are sometimes [dropped, or lost](https://github.com/zmkfirmware/zmk/issues/84). + - The Zephyr USB stack does not have a built in queue for endpoint data being written. As a result, HID events sent by ZMK are sometimes dropped, or lost. - Fixed by careyk007 in #93. ## Next Steps -- cgit v1.3.1 From ae104374c0af0c2cbf9d246f980ccce56e60c105 Mon Sep 17 00:00:00 2001 From: Cody McGinnis Date: Tue, 18 Aug 2020 14:02:24 -0400 Subject: feat(docs): document the toggle layer behavior --- docs/docs/behavior/layers.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'docs') diff --git a/docs/docs/behavior/layers.md b/docs/docs/behavior/layers.md index 2388caf..09defad 100644 --- a/docs/docs/behavior/layers.md +++ b/docs/docs/behavior/layers.md @@ -39,3 +39,18 @@ Example: ``` &mo LOWER ``` + +## Toggle Layer + +The "toggle layer" behavior allows you to enable a layer until the layer is manually disabled. + +### Behavior Binding + +- Reference: `&tog` +- Parameter: The layer number to enable/disable, e.g. `1` + +Example: + +``` +&tog LOWER +``` \ No newline at end of file -- cgit v1.3.1 From bb4f45a57a5d8c62b911cefdada1f80d1ff70a71 Mon Sep 17 00:00:00 2001 From: Cody McGinnis Date: Tue, 18 Aug 2020 14:02:25 -0400 Subject: fix(docs): add another example to toggle layer --- docs/docs/behavior/layers.md | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/docs/behavior/layers.md b/docs/docs/behavior/layers.md index 09defad..3e520ca 100644 --- a/docs/docs/behavior/layers.md +++ b/docs/docs/behavior/layers.md @@ -53,4 +53,40 @@ Example: ``` &tog LOWER -``` \ No newline at end of file +``` + +"Toggle layer" for a : +``` +#define DEFAULT 0 +#define NAVI 1 + +#define NONE 0 + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { + bindings = < + &tog NAVI &kp KDIV &kp KMLT &kp KMIN + &kp NUM_7 &kp NUM_8 &kp NUM_9 &kp KPLS + &kp NUM_4 &kp NUM_5 &kp NUM_6 &kp KPLS + &kp NUM_1 &kp NUM_2 &kp NUM_3 &kp RET + &kp NUM_0 &kp NUM_0 &kp DOT &kp RET + >; + }; + + nav_layer { + bindings = < + &tog NAVI &kp KDIV &kp KMLT &kp KMIN + &kp HOME &kp UARW &kp PGUP &kp KPLS + &kp LARW &none &kp RARW &kp KPLS + &kp END &kp DARW &kp PGDN &kp RET + &kp INS &kp INS &kp DEL &kp RET + >; + }; + }; +}; +``` + +It is possible to use "toggle layer" to have keys that raise and lower the layers as well. \ No newline at end of file -- cgit v1.3.1 From 2ffe09b617419a25e45c387e001ea59d3cbb5652 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Tue, 18 Aug 2020 14:11:48 -0400 Subject: fix(docs): Fix typo in key press behavior doc. --- docs/docs/behavior/key-press.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/docs/behavior/key-press.md b/docs/docs/behavior/key-press.md index 08296bb..1ae7e31 100644 --- a/docs/docs/behavior/key-press.md +++ b/docs/docs/behavior/key-press.md @@ -4,7 +4,7 @@ title: Key Presses ## Summary -The most basic of behaiors, is the ability to send certain keycode presses and releases in response to activating +The most basic of behaviors, is the ability to send certain keycode presses and releases in response to activating a certain key. For reference on keycode values, see the [USB HID Usage Tables](https://www.usb.org/document-library/hid-usage-tables-12). -- cgit v1.3.1 From 63e02d60dcfbf4e4d7f9954075d1e087f816944b Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Tue, 18 Aug 2020 14:14:28 -0400 Subject: feat(behaviors): Add &none behavior --- app/CMakeLists.txt | 1 + app/dts/behaviors.dtsi | 1 + app/dts/behaviors/none.dtsi | 15 +++++++ app/dts/bindings/behaviors/zmk,behavior-none.yaml | 8 ++++ app/src/behaviors/behavior_none.c | 48 +++++++++++++++++++++++ docs/docs/behavior/misc.md | 41 +++++++++++++++++++ docs/sidebars.js | 1 + 7 files changed, 115 insertions(+) create mode 100644 app/dts/behaviors/none.dtsi create mode 100644 app/dts/bindings/behaviors/zmk,behavior-none.yaml create mode 100644 app/src/behaviors/behavior_none.c create mode 100644 docs/docs/behavior/misc.md (limited to 'docs') diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index d0d343b..28a1204 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -39,6 +39,7 @@ target_sources(app PRIVATE src/behaviors/behavior_reset.c) target_sources(app PRIVATE src/behaviors/behavior_mod_tap.c) target_sources(app PRIVATE src/behaviors/behavior_momentary_layer.c) target_sources(app PRIVATE src/behaviors/behavior_transparent.c) +target_sources(app PRIVATE src/behaviors/behavior_none.c) target_sources(app PRIVATE src/behaviors/behavior_sensor_rotate_key_press.c) target_sources_ifdef(CONFIG_ZMK_RGB_UNDERGLOW app PRIVATE src/behaviors/behavior_rgb_underglow.c) target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/ble.c) diff --git a/app/dts/behaviors.dtsi b/app/dts/behaviors.dtsi index 04e42b6..5302c17 100644 --- a/app/dts/behaviors.dtsi +++ b/app/dts/behaviors.dtsi @@ -1,5 +1,6 @@ #include #include +#include #include #include #include diff --git a/app/dts/behaviors/none.dtsi b/app/dts/behaviors/none.dtsi new file mode 100644 index 0000000..e84ed49 --- /dev/null +++ b/app/dts/behaviors/none.dtsi @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2020 Pete Johanson + * + * SPDX-License-Identifier: MIT + */ + +/ { + behaviors { + none: behavior_none { + compatible = "zmk,behavior-none"; + label = "NONE"; + #binding-cells = <0>; + }; + }; +}; diff --git a/app/dts/bindings/behaviors/zmk,behavior-none.yaml b/app/dts/bindings/behaviors/zmk,behavior-none.yaml new file mode 100644 index 0000000..9c66c94 --- /dev/null +++ b/app/dts/bindings/behaviors/zmk,behavior-none.yaml @@ -0,0 +1,8 @@ +# Copyright (c) 2020, Pete Johanson +# SPDX-License-Identifier: MIT + +description: None Binding Behavior + +compatible: "zmk,behavior-none" + +include: zero_param.yaml diff --git a/app/src/behaviors/behavior_none.c b/app/src/behaviors/behavior_none.c new file mode 100644 index 0000000..7e77e54 --- /dev/null +++ b/app/src/behaviors/behavior_none.c @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2020 Peter Johanson + * + * SPDX-License-Identifier: MIT + */ + +#define DT_DRV_COMPAT zmk_behavior_none + +#include +#include +#include +#include + +LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); + +struct behavior_none_config { }; +struct behavior_none_data { }; + +static int behavior_none_init(struct device *dev) +{ + return 0; +}; + +static int on_keymap_binding_pressed(struct device *dev, u32_t position, u32_t _param1, u32_t _param2) +{ + return 1; +} + +static int on_keymap_binding_released(struct device *dev, u32_t position, u32_t _param1, u32_t _param2) +{ + return 1; +} + +static const struct behavior_driver_api behavior_none_driver_api = { + .binding_pressed = on_keymap_binding_pressed, + .binding_released = on_keymap_binding_released, +}; + + +static const struct behavior_none_config behavior_none_config = {}; + +static struct behavior_none_data behavior_none_data; + +DEVICE_AND_API_INIT(behavior_none, DT_INST_LABEL(0), behavior_none_init, + &behavior_none_data, + &behavior_none_config, + APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, + &behavior_none_driver_api); \ No newline at end of file diff --git a/docs/docs/behavior/misc.md b/docs/docs/behavior/misc.md new file mode 100644 index 0000000..799c91c --- /dev/null +++ b/docs/docs/behavior/misc.md @@ -0,0 +1,41 @@ +--- +title: Miscellaneous +--- + +## Summary + +There are a few miscellaneous behaviors that are helpful when working with layers in keymaps, +in particular, with handling what happens in higher layers, and if events are passed to +the next layer or not + +## Transparent + +The transparent behavior simply ignores key position presses/releases, so they will be +passed down to the next active layer in the stack. + +### Behavior Binding + +- Reference: `&trans` +- Parameters: None + +Example: + +``` +&trans +``` + +## None + +The none behavior simply swallows and stops key position presses/releases, so they will **not** +be passed down to the next active layer in the stack. + +### Behavior Binding + +- Reference: `&none` +- Parameters: None + +Example: + +``` +&none +``` diff --git a/docs/sidebars.js b/docs/sidebars.js index 1bd0358..90bdfa2 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -10,6 +10,7 @@ module.exports = { Behaviors: [ "behavior/key-press", "behavior/layers", + "behavior/misc", "behavior/lighting", ], Development: [ -- cgit v1.3.1 From d2d9fc86cf0ed0ab4bb896ee247fb212512d5aaf Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Tue, 18 Aug 2020 15:24:38 -0400 Subject: feat(docs): Basic mod-tap behavior docs. --- docs/docs/behavior/mod-tap.md | 29 +++++++++++++++++++++++++++++ docs/sidebars.js | 1 + 2 files changed, 30 insertions(+) create mode 100644 docs/docs/behavior/mod-tap.md (limited to 'docs') diff --git a/docs/docs/behavior/mod-tap.md b/docs/docs/behavior/mod-tap.md new file mode 100644 index 0000000..cae667e --- /dev/null +++ b/docs/docs/behavior/mod-tap.md @@ -0,0 +1,29 @@ +--- +title: Mod-Tap +--- + +## Summary + +The Mod-Tap behavior allows varying the effect of pressing and releasing a key position depending +on whether it is used with other simultaneous key presses at the same time. + +If pressed and released independently, the Mod-Tap behavior will send the press and release events +for the configure keycode. If pressed and held while another key is pressed and released, then +the configured modifiers will be applied to that _other_ key press, and no press will be generated +on the release of the Mod-Tap key. + +## Mod-Tap + +The Mod-Tap behavior either acts as a held modifier, or as a tapped keycode. + +### Behavior Binding + +- Reference: `&mt` +- Parameter #1: The modifiers to be used when activating as a modifier, e.g. `MOD_LSFT` +- Parameter #2: The keycode to sent when used as a tap, e.g. `A`, `B`. + +Example: + +``` +&mt MOD_LSFT A +``` diff --git a/docs/sidebars.js b/docs/sidebars.js index 90bdfa2..be02a65 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -11,6 +11,7 @@ module.exports = { "behavior/key-press", "behavior/layers", "behavior/misc", + "behavior/mod-tap", "behavior/lighting", ], Development: [ -- cgit v1.3.1