Skip to content

Commit

Permalink
Merge branch 'V3.0' into V3.0-beta
Browse files Browse the repository at this point in the history
* V3.0: (22 commits)
  remove extra &none keys for ZMK V3.0
  Add instructions for upgrading from V2 to V3 in README (KinesisCorporation#197)
  V3.0 Update
  align fn keys
  disable mode tap
  disable auto shift
  fully restore backlight
  restore backlight maps
  .
  .
  add right command
  rm underglow and backlight
  rm layer tap
  .
  .
  add media key todo
  reenable backlight
  add missing &kp
  attempt fix parse error
  try autoshift
  ...
  • Loading branch information
alok committed Sep 5, 2023
2 parents 654585a + e198f25 commit f0e99f1
Show file tree
Hide file tree
Showing 11 changed files with 142 additions and 13 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ Follow the programming instruction on page 8 of the [Quick Start Guide](https://

> Note: There are also physical reset buttons on both keyboards which can be used to enter and exit the bootloader mode. Their location is described in section 2.7 on page 9 in the [User Manual](https://kinesis-ergo.com/wp-content/uploads/Advantage360-ZMK-KB360-PRO-Users-Manual-v3-10-23.pdf) and use is described in section 5.9 on page 14.
### Upgrading from V2 to V3

If you are upgrading from V2 to V3, and if the flashing didn't work as expected (i.e. if you are unable to pair the keyboard via Bluetooth), then consider [resetting](https://kinesis-ergo.com/support/kb360pro/#firmware-updates) both halves of the keyboard to its native state. Make sure to use the `settings-reset.uf2` file from
the V3 branch of this repository. After doing this, proceed with the flashing instructions above.

## Other support

Further support resources can be found on Kinesis.com:
Expand Down
4 changes: 4 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- [ ] move onboard settings
- [ ] move karabiner settings
- [ ] mess w/ zmk

62 changes: 62 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Advantage 360 Pro ZMK upgrade guide

The last V2.0 update and the new V3.0 branch have introduced changes into the keymap files that causes merge conflicts for people updating with custom keymaps. This guide covers what changed, why it changed and how to fix it.

## What changed and why

To resolve issues some users were encountering with out of matrix keypresses, as well as to streamline the keymap for all future updates, several keys that are unused were removed from the keymap and [matrix transform](https://zmk.dev/docs/config/kscan#matrix-transform). Formatting was also standardised to fall in line with ZMK formatting conventions. As a result the board definition for the Advantage 360 Pro as it stands to get merged into ZMK main [here](https://github.com/zmkfirmware/zmk/pull/1454) matches the one in this repository to the greatest extent possible.
These changes result in a merge conflict when two diverging git branches try to get added together in the updating procedure.
This sort of breaking change shouldn't happen again in the future.

## How to solve the merge conflict

In order to solve the merge conflict all that has to be done is for the conflicting key behaviours to be manually removed from two files.
- adv360.keymap

![The highlighted &none behaviours that need removing](/assets/keymap.jpg)
- keymap.json

![The highlighted &none behaviours that need removing](/assets/json.jpg)

These highlighted keys must be removed from each layer in both files. Be careful to preserve a comma in between every key behaviour in the keymap.json and at least one space between every behaviour in adv360.keymap or firmware builds will fail. The quotes need correctly preserving on the behaviours in keymap.json. Each behaviour needs to be wrapped in quotes. Whitespace within the quotes is ignored.
If you try to update your fork using the GitHub web interface you will see an error saying "This branch has merge conflicts and cannot be merged automatically" and you will be prompted to open a pull request instead. Solving the merge conflict this way is more challenging than doing it on GitHub desktop.

### Github Desktop

This assumes you already have [GitHub desktop](https://desktop.github.com/) downloaded, installed and you have logged in using the GitHub credentials for your account. Whilst it would be helpful to have an alternative text editor such as VSCode installed this task can be completed with notepad
1. Clone your repository

Navigate in the menu to File->Clone repository. Your fork of the Adv360-Pro-ZMK repository should be visible in the menu of repositories to choose from. Click the blue "Clone" button
2. Open the folder

Open the folder by using the "Show in your file manager" option and navigate to the "config" folder
3. Edit keymap.json

Open keymap.json, and for each layer remove the 8 highlighted &none behaviours including the quotes wrapping them, and the commas
4. Edit adv 360.keymap

Open adv360.keymap and remove the 8 highlighted &none behaviours in each later
5. Commit your changes

Returning to GitHub desktop you should see the changes you made in the bar on the left. Type an appropriate commit summary and click "Commit to *branch name*"

![The commit dialog of GitHub Desktop](/assets/commit.jpg)

6. Merge

Navigate to Branch->Merge into current branch and select "upstream/V2.0" or "upstream/V3.0". You will see a warning that there will be two conflicted files. Click "Create a merge commit".

![The merge dialog showing a warning of conflicts](/assets/merge.jpg)

7. Resolve Conflicts

The conflict resolution window has powerful options to soresolve the merge conflict, you will want to clik on the down arrow next to "Open in *your text editor*" and click use the modified file from *your branch name*. In the case of this example it is called V2.0-beta. Using the file from upstream/V2.0 or upstream/V3.0 will result in none of your keymap changes being preserved.
Do this for both files then you will be able to click the "Continue Merge" option

![The merge dialog showing a warning of conflicts](/assets/conflict.jpg)
8. Push

Once the merge is complete you should be able to click the "push origin" button in the top bar. At this point your changes should be uploaded to GitHub servers and the build should start
9. Test your firmware

When the build succeeds download the uf2 files and flash them as normal. Test the keymap, if keys are shifted one way or the other it's likely you deleted too many or not enough behaviours.
Binary file added assets/commit.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/conflict.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/json.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/keymap.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/merge.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 46 additions & 10 deletions config/adv360.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
#include <dt-bindings/zmk/rgb.h>
#include <dt-bindings/zmk/backlight.h>

#define AS(keycode) &as LS(keycode) keycode // Autoshift Macro
#define HYP LS(LC(LA(LGUI)))
#define HYPER(key) LS(LC(LA(LG(key))))

// Friendlier volume definitions, tap volume down, hold mute
#define VOLUME_DOWN K_MUTE C_VOLUME_DOWN
#define VOLUME_UP C_VOLUME_UP

/ {
behaviors {
#include "macros.dtsi"
Expand All @@ -17,18 +25,45 @@
flavor = "tap-preferred";
bindings = <&kp>, <&kp>;
};
as: auto_shift {
compatible = "zmk,behavior-hold-tap";
label = "AUTO_SHIFT";
#binding-cells = <2>;
tapping_term_ms = <130>;
quick_tap_ms = <0>;
flavor = "tap-preferred";
bindings = <&kp>, <&kp>;
};
td_media: tap_dance_media {
compatible = "zmk,behavior-tap-dance";
label = "TAP_DANCE_MEDIA";
#binding-cells = <0>;
tapping-term-ms = <90>;
bindings = <&kp C_PLAY_PAUSE>, <&kp C_NEXT>, <&kp C_PREVIOUS>;
};
};
// TODO: https://github.com/rastasheep/zmk-config/blob/master/config/lily58.keymap td media keys
// TODO: use &lt and &tog for left index homerow and circled 2 keys
// TODO: fix AS() bindings to not be so slow
// TODO: restore shift space in firmware
// bindings = <
// AS(GRAVE) AS(N1) AS(N2) AS(N3) AS(N4) AS(N5) &tog 1 &mo 3 AS(N6) AS(N7) AS(N8) AS(N9) AS(N0) AS(MINUS)
// &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp F20 &kp F21 &kp Y &kp U &kp I &kp O &kp P AS(BSLH)
// &mt LEFT_CONTROL ESC &kp A &kp S &kp D &kp F &kp G &kp F22 &kp LCTRL &td_media &kp LEFT_COMMAND &kp RIGHT_COMMAND &kp F23 &kp H &kp J &kp K &kp L &kp SEMI AS(SQT)
// &kp LEFT_SHIFT &kp Z &kp X &kp C &kp V &kp B &kp HOME &kp PG_UP &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RIGHT_SHIFT
// &mo 2 &kp LEFT &kp RIGHT AS(MINUS) AS(EQUAL) &mt LEFT_SHIFT SPACE &kp LEFT_COMMAND &kp END &kp PG_DN &mt LEFT_ALT ENTER &mt LEFT_CONTROL BACKSPACE AS(LEFT_BRACKET) AS(RIGHT_BRACKET) &kp DOWN &kp UP &mo 2
// >;

keymap {
compatible = "zmk,keymap";

default_layer {
bindings = <
&kp EQUAL &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &tog 1 &mo 3 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS
&kp TAB &kp Q &kp W &kp E &kp R &kp T &none &none &kp Y &kp U &kp I &kp O &kp P &kp BSLH
&kp ESC &kp A &kp S &kp D &kp F &kp G &none &kp LCTRL &kp LALT &kp LGUI &kp RCTRL &none &kp H &kp J &kp K &kp L &kp SEMI &kp SQT
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp HOME &kp PG_UP &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT
&mo 2 &kp GRAVE &kp CAPS &kp LEFT &kp RIGHT &kp BSPC &kp DEL &kp END &kp PG_DN &kp ENTER &kp SPACE &kp UP &kp DOWN &kp LBKT &kp RBKT &mo 2
&kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &tog 1 &mo 3 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp F20 &kp F21 &kp Y &kp U &kp I &kp O &kp P &kp BSLH
&kp ESC &kp A &kp S &kp D &kp F &kp G &kp F22 &kp LCTRL &td_media &kp LEFT_COMMAND &kp RIGHT_COMMAND &kp F23 &kp H &kp J &kp K &kp L &kp SEMI &kp SQT
&kp LEFT_SHIFT &kp Z &kp X &kp C &kp V &kp B &kp HOME &kp PG_UP &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RIGHT_SHIFT
&mo 2 &kp LEFT &kp RIGHT &kp MINUS &kp EQUAL &kp SPACE &kp LEFT_COMMAND &kp END &kp PG_DN &kp ENTER &kp BACKSPACE &kp LEFT_BRACKET &kp RIGHT_BRACKET &kp DOWN &kp UP &mo 2
>;
};
keypad {
Expand All @@ -42,11 +77,12 @@
};
fn {
bindings = <
&kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &tog 1 &mo 3 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12
&trans &trans &trans &trans &trans &trans &none &none &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &none &trans &trans &trans &trans &none &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans

&kp F12 &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &tog 1 &mo 3 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11
&trans &trans &trans &trans &trans &trans &none &none &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &none &trans &trans &trans &trans &none &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
>;
};
mod {
Expand Down
6 changes: 3 additions & 3 deletions config/keymap.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
], [
"&none ", "&bt BT_SEL 0 ", "&bt BT_SEL 1 ", "&bt BT_SEL 2 ", "&bt BT_SEL 3 ", "&bt BT_SEL 4 ", "&none ", "&trans ", "&none ", "&none ", "&none ", "&none ", "&none ", "&none",
"&none ", "&none ", "&none ", "&none ", "&none ", "&none ", "&bootloader ", "&bootloader ", "&none ", "&none ", "&none ", "&none ", "&none ", "&none",
"&none ", "&none ", "&none ", "&none ", "&none ", "&none ", "&rgb_ug RGB_MEFS_CMD 5 ", "&none", "&bt BT_CLR ", "&bt BT_CLR ", "&bt BT_CLR ", "&rgb_ug RGB_MEFS_CMD 5 ", "&none ", "&none ", "&none ", "&none ", "&none ", "&none",
"&none ", "&none ", "&none ", "&none ", "&none ", "&none ", "&none ", "&none ", "&none ", "&none ", "&none ", "&none ", "&none ", "&none ", "&none ", "&none",
"&none ", "&none ", "&none ", "&bl BL_INC ", "&bl BL_DEC ", "&none ", "&bl BL_TOG ", "&none ", "&none ", "&bl BL_TOG ", "&rgb_ug RGB_TOG ", "&bl BL_INC ", "&bl BL_DEC ", "&none ", "&none ", "&none"
"&none ", "&none ", "&none ", "&none ", "&none ", "&none ", "&none ", "&none", "&none ", "&bt BT_CLR ", "&none ", "&rgb_ug RGB_MEFS_CMD 5 ", "&none ", "&none ", "&none ", "&none ", "&none ", "&none",
"&none ", "&none ", "&none ", "&none ", "&none ", "&none ", "&none ", "&none ", "&none ", "&none ", "&none ", "&none ", "&none ", "&none",
"&none ", "&none ", "&none ", "&none ", "&none ", "&none", "&none", "&none ", "&none ", "&bl BL_TOG ", "&rgb_ug RGB_TOG ", "&bl BL_INC ", "&bl BL_DEC ", "&none ", "&none ", "&none"
]
]
}
22 changes: 22 additions & 0 deletions kinesis-settings.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[=]>[`]
[up]>[obrack]
[down]>[cbrack]
[obrack]>[down]
[cbrack]>[up]
[scroll]>[shutdn]
[right]>[=]
[left]>[hyphen]
[intl-\]>[right]
[`]>[left]
[kp=]>[kp=mac]
[hyphen]>[F8]
[lalt]>[pause]
[lctrl]>[rctrl]
[kp-lctrl]>[kp-lwin]
[delete]>[lwin]
[bspace]>[space]
[rctrl]>[rwin]
[kp-rctrl]>[kp-rwin]
[space]>[bspace]
[rwin]>[pause]
[kp-rwin]>[kp-rctrl]

0 comments on commit f0e99f1

Please # to comment.