From ac8bc2d322e08f421d2e6d1e9b599c21ea354d4d Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Thu, 2 Jul 2020 23:58:37 +0200 Subject: [PATCH 1/3] examples/Keyboardio/Atreus: Fix the QWERTY layer & macro mess On the `Upper` layer we have a key that takes us back to the QWERTY layer. That key appeared as `M(QWERTY)` on the keymap, while `QWERTY` was the layer name, and `LAYER_QWERTY` was supposed to be the macro name. In the macro itself, we used `Layer.move(LAYER_QWERTY)` - the macro name instead of the layer name. In practice, this didn't matter, because both ended up resolving to `0`, but the code did not reflect intention, and was confusing for anyone trying to understand what's going on. Signed-off-by: Gergely Nagy --- examples/Devices/Keyboardio/Atreus/Atreus.ino | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/Devices/Keyboardio/Atreus/Atreus.ino b/examples/Devices/Keyboardio/Atreus/Atreus.ino index b57c4e07..a8a2512d 100644 --- a/examples/Devices/Keyboardio/Atreus/Atreus.ino +++ b/examples/Devices/Keyboardio/Atreus/Atreus.ino @@ -33,7 +33,7 @@ #define TG(n) LockLayer(n) enum { - LAYER_QWERTY + MACRO_QWERTY }; #define Key_Exclamation LSHIFT(Key_1) @@ -82,15 +82,15 @@ KEYMAPS( [UPPER] = KEYMAP_STACKED ( - Key_Insert ,Key_Home ,Key_UpArrow ,Key_End ,Key_PageUp - ,Key_Delete ,Key_LeftArrow ,Key_DownArrow ,Key_RightArrow ,Key_PageDown - ,XXX ,Consumer_VolumeIncrement ,XXX ,XXX ,___ ,___ - ,M(QWERTY) ,Consumer_VolumeDecrement ,___ ,___ ,___ ,___ - - ,Key_UpArrow ,Key_F7 ,Key_F8 ,Key_F9 ,Key_F10 - ,Key_DownArrow ,Key_F4 ,Key_F5 ,Key_F6 ,Key_F11 - ,___ ,XXX ,Key_F1 ,Key_F2 ,Key_F3 ,Key_F12 - ,___ ,___ ,M(QWERTY) ,Key_PrintScreen ,Key_ScrollLock ,Consumer_PlaySlashPause + Key_Insert ,Key_Home ,Key_UpArrow ,Key_End ,Key_PageUp + ,Key_Delete ,Key_LeftArrow ,Key_DownArrow ,Key_RightArrow ,Key_PageDown + ,XXX ,Consumer_VolumeIncrement ,XXX ,XXX ,___ ,___ + ,M(MACRO_QWERTY) ,Consumer_VolumeDecrement ,___ ,___ ,___ ,___ + + ,Key_UpArrow ,Key_F7 ,Key_F8 ,Key_F9 ,Key_F10 + ,Key_DownArrow ,Key_F4 ,Key_F5 ,Key_F6 ,Key_F11 + ,___ ,XXX ,Key_F1 ,Key_F2 ,Key_F3 ,Key_F12 + ,___ ,___ ,M(MACRO_QWERTY) ,Key_PrintScreen ,Key_ScrollLock ,Consumer_PlaySlashPause ) ) /* *INDENT-ON* */ @@ -110,8 +110,8 @@ KALEIDOSCOPE_INIT_PLUGINS( const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) { switch (macroIndex) { - case QWERTY: - Layer.move(LAYER_QWERTY); + case MACRO_QWERTY: + Layer.move(QWERTY); break; default: break; From 36eb7d04cc71ca27907becee2142e8feca327a67 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Fri, 3 Jul 2020 00:03:34 +0200 Subject: [PATCH 2/3] examples/Keyboardio/Atreus: Use `MoveToLayer` On the `Upper` layer, we used to have a macro that moved us back to the QWERTY layer. It was made before we had `MoveToLayer` available. Now that we do have it, lets use that instead of the macro. We still keep the macro around, for the sake of compatibility, so that if anyone who has the old macro in EEPROM, but updates the firmware, will have the key working still. Signed-off-by: Gergely Nagy --- examples/Devices/Keyboardio/Atreus/Atreus.ino | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/examples/Devices/Keyboardio/Atreus/Atreus.ino b/examples/Devices/Keyboardio/Atreus/Atreus.ino index a8a2512d..150550fe 100644 --- a/examples/Devices/Keyboardio/Atreus/Atreus.ino +++ b/examples/Devices/Keyboardio/Atreus/Atreus.ino @@ -82,15 +82,15 @@ KEYMAPS( [UPPER] = KEYMAP_STACKED ( - Key_Insert ,Key_Home ,Key_UpArrow ,Key_End ,Key_PageUp - ,Key_Delete ,Key_LeftArrow ,Key_DownArrow ,Key_RightArrow ,Key_PageDown - ,XXX ,Consumer_VolumeIncrement ,XXX ,XXX ,___ ,___ - ,M(MACRO_QWERTY) ,Consumer_VolumeDecrement ,___ ,___ ,___ ,___ - - ,Key_UpArrow ,Key_F7 ,Key_F8 ,Key_F9 ,Key_F10 - ,Key_DownArrow ,Key_F4 ,Key_F5 ,Key_F6 ,Key_F11 - ,___ ,XXX ,Key_F1 ,Key_F2 ,Key_F3 ,Key_F12 - ,___ ,___ ,M(MACRO_QWERTY) ,Key_PrintScreen ,Key_ScrollLock ,Consumer_PlaySlashPause + Key_Insert ,Key_Home ,Key_UpArrow ,Key_End ,Key_PageUp + ,Key_Delete ,Key_LeftArrow ,Key_DownArrow ,Key_RightArrow ,Key_PageDown + ,XXX ,Consumer_VolumeIncrement ,XXX ,XXX ,___ ,___ + ,MoveToLayer(QWERTY) ,Consumer_VolumeDecrement ,___ ,___ ,___ ,___ + + ,Key_UpArrow ,Key_F7 ,Key_F8 ,Key_F9 ,Key_F10 + ,Key_DownArrow ,Key_F4 ,Key_F5 ,Key_F6 ,Key_F11 + ,___ ,XXX ,Key_F1 ,Key_F2 ,Key_F3 ,Key_F12 + ,___ ,___ ,MoveToLayer(QWERTY) ,Key_PrintScreen ,Key_ScrollLock ,Consumer_PlaySlashPause ) ) /* *INDENT-ON* */ @@ -111,6 +111,10 @@ KALEIDOSCOPE_INIT_PLUGINS( const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) { switch (macroIndex) { case MACRO_QWERTY: + // This macro is currently unused, but is kept around for compatibility + // reasons. We used to use it in place of `MoveToLayer(QWERTY)`, but no + // longer do. We keep it so that if someone still has the old layout with + // the macro in EEPROM, it will keep working after a firmware update. Layer.move(QWERTY); break; default: From 57fd064192d3caa34557caf3aaad22bc1a2970b2 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Fri, 3 Jul 2020 00:10:06 +0200 Subject: [PATCH 3/3] examples/Keyboardio/Atreus: Add a Model01-style version info macro Add a Model01-style version info macro (which types `Keyboardio Atreus - $version`) to UPPER+Z. Signed-off-by: Gergely Nagy --- examples/Devices/Keyboardio/Atreus/Atreus.ino | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/examples/Devices/Keyboardio/Atreus/Atreus.ino b/examples/Devices/Keyboardio/Atreus/Atreus.ino index 150550fe..8e1781ff 100644 --- a/examples/Devices/Keyboardio/Atreus/Atreus.ino +++ b/examples/Devices/Keyboardio/Atreus/Atreus.ino @@ -17,6 +17,10 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#ifndef BUILD_INFORMATION +#define BUILD_INFORMATION "locally built" +#endif + #include "Kaleidoscope.h" #include "Kaleidoscope-EEPROM-Settings.h" #include "Kaleidoscope-EEPROM-Keymap.h" @@ -33,7 +37,8 @@ #define TG(n) LockLayer(n) enum { - MACRO_QWERTY + MACRO_QWERTY, + MACRO_VERSION_INFO }; #define Key_Exclamation LSHIFT(Key_1) @@ -82,10 +87,10 @@ KEYMAPS( [UPPER] = KEYMAP_STACKED ( - Key_Insert ,Key_Home ,Key_UpArrow ,Key_End ,Key_PageUp - ,Key_Delete ,Key_LeftArrow ,Key_DownArrow ,Key_RightArrow ,Key_PageDown - ,XXX ,Consumer_VolumeIncrement ,XXX ,XXX ,___ ,___ - ,MoveToLayer(QWERTY) ,Consumer_VolumeDecrement ,___ ,___ ,___ ,___ + Key_Insert ,Key_Home ,Key_UpArrow ,Key_End ,Key_PageUp + ,Key_Delete ,Key_LeftArrow ,Key_DownArrow ,Key_RightArrow ,Key_PageDown + ,M(MACRO_VERSION_INFO) ,Consumer_VolumeIncrement ,XXX ,XXX ,___ ,___ + ,MoveToLayer(QWERTY) ,Consumer_VolumeDecrement ,___ ,___ ,___ ,___ ,Key_UpArrow ,Key_F7 ,Key_F8 ,Key_F9 ,Key_F10 ,Key_DownArrow ,Key_F4 ,Key_F5 ,Key_F6 ,Key_F11 @@ -117,6 +122,12 @@ const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) { // the macro in EEPROM, it will keep working after a firmware update. Layer.move(QWERTY); break; + case MACRO_VERSION_INFO: + if (keyToggledOn(keyState)) { + Macros.type(PSTR("Keyboardio Atreus - Kaleidoscope ")); + Macros.type(PSTR(BUILD_INFORMATION)); + } + break; default: break; }