]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Merge remote-tracking branch 'refs/remotes/jackhumbert/master'
authorIBNobody <ibnobody@gmail.com>
Sun, 25 Sep 2016 21:36:30 +0000 (16:36 -0500)
committerIBNobody <ibnobody@gmail.com>
Sun, 25 Sep 2016 21:36:30 +0000 (16:36 -0500)
43 files changed:
keyboards/ergodox/ez/rules.mk
keyboards/ergodox/keymaps/algernon/Makefile
keyboards/ergodox/keymaps/algernon/images/adore-layer.png
keyboards/ergodox/keymaps/algernon/images/base-layer.png
keyboards/ergodox/keymaps/algernon/images/heatmap.png
keyboards/ergodox/keymaps/algernon/keymap.c
keyboards/ergodox/keymaps/algernon/readme.md
keyboards/ergodox/keymaps/algernon/tools/heatmap-layout.ADORE.json
keyboards/ergodox/keymaps/algernon/tools/heatmap-layout.Dvorak.json
keyboards/ergodox/keymaps/algernon/tools/hid-commands [new file with mode: 0755]
keyboards/ergodox/keymaps/algernon/tools/layer-notify [new file with mode: 0755]
keyboards/ergodox/keymaps/algernon/tools/log-to-heatmap.py
keyboards/ergodox/keymaps/algernon/tools/max-focused [deleted file]
keyboards/ergodox/keymaps/algernon/tools/text-to-log.py [new file with mode: 0755]
keyboards/ergodox/keymaps/default/keymap.c
keyboards/ergodox/keymaps/default/readme.md
keyboards/kc60/config.h
keyboards/lets_split/config.h
keyboards/lets_split/i2c.c
keyboards/lets_split/keymaps/i2c/config.h [new file with mode: 0644]
keyboards/lets_split/keymaps/i2c/keymap.c [new file with mode: 0644]
keyboards/lets_split/keymaps/serial/config.h [new file with mode: 0644]
keyboards/lets_split/keymaps/serial/keymap.c [new file with mode: 0644]
keyboards/lets_split/matrix.c
keyboards/lets_split/rules.mk
keyboards/lets_split/serial.c
keyboards/lets_split/split_util.c
keyboards/planck/keymaps/impossible/Makefile [new file with mode: 0644]
keyboards/planck/keymaps/impossible/keymap.c [new file with mode: 0644]
keyboards/planck/keymaps/impossible/readme.md [new file with mode: 0644]
keyboards/tada68/Makefile [new file with mode: 0644]
keyboards/tada68/config.h [new file with mode: 0644]
keyboards/tada68/keymaps/default/Makefile [new file with mode: 0644]
keyboards/tada68/keymaps/default/keymap.c [new file with mode: 0644]
keyboards/tada68/keymaps/default/readme.md [new file with mode: 0644]
keyboards/tada68/readme.md [new file with mode: 0644]
keyboards/tada68/rules.mk [new file with mode: 0644]
keyboards/tada68/tada68.c [new file with mode: 0644]
keyboards/tada68/tada68.h [new file with mode: 0644]
quantum/process_keycode/process_tap_dance.c
quantum/process_keycode/process_tap_dance.h
readme.md
tmk_core/common/action.c

index 37e554b30457804a43576c2c13856f5ab6ee35dc..a9715beb8573d3c86b031036aeb728faec2a88cb 100644 (file)
@@ -71,6 +71,8 @@ OPT_DEFS += -DBOOTLOADER_SIZE=512
 #   comment out to disable the options.
 #
 
+SLEEP_LED_ENABLE = no
+
 ifndef QUANTUM_DIR
        include ../../../Makefile
 endif
index 7c2b3ad97cee6dacd04117eca7102c4bc2c9c43f..699add3ddafd3fcda0b51083a4b2f6fcfb73b3c3 100644 (file)
@@ -7,7 +7,7 @@ CONSOLE_ENABLE = no
 TAP_DANCE_ENABLE = yes
 KEYLOGGER_ENABLE ?= yes
 UCIS_ENABLE = yes
-MOUSEKEY_ENABLE ?= yes
+MOUSEKEY_ENABLE = no
 
 AUTOLOG_ENABLE ?= no
 
@@ -25,6 +25,8 @@ OPT_DEFS += -DKEYLOGGER_ENABLE
 CONSOLE_ENABLE = yes
 endif
 
+OPT_DEFS += -DUSER_PRINT
+
 KEYMAP_VERSION = $(shell \
  if [ -d "${KEYMAP_PATH}/.git" ]; then \
   cd "${KEYMAP_PATH}" && git describe --abbrev=6 --dirty --always --tags --match 'v*' 2>/dev/null; \
index 3d0a5fb20cd426a3a79d1b581b1a84d1cd71a8c1..b611fbc42a702ac135e9fa870aa664c8386a4f68 100644 (file)
Binary files a/keyboards/ergodox/keymaps/algernon/images/adore-layer.png and b/keyboards/ergodox/keymaps/algernon/images/adore-layer.png differ
index 7ea57aae38e3833b2f8932cc83f3063b95785588..2a981a4706c6cb719c05f95a9b476f781d1c2294 100644 (file)
Binary files a/keyboards/ergodox/keymaps/algernon/images/base-layer.png and b/keyboards/ergodox/keymaps/algernon/images/base-layer.png differ
index 356035e0a60a9307ce6fe81f36cde97a3bd84071..4f55c5adff5703a3b61ac5198694375ad49a405b 100644 (file)
Binary files a/keyboards/ergodox/keymaps/algernon/images/heatmap.png and b/keyboards/ergodox/keymaps/algernon/images/heatmap.png differ
index 9f476d8a6b5b71c58fb4622816cc6d5c98c7db89..248a0ed303ad91af93c02070a7d4249c3c741ac1 100644 (file)
@@ -8,7 +8,6 @@
 #include "debug.h"
 #include "action_layer.h"
 #include "action_util.h"
-#include "mousekey.h"
 #include "timer.h"
 #include "keymap_plover.h"
 #include "eeconfig.h"
@@ -36,18 +35,6 @@ enum {
   A_PLVR,
   A_MPN,
 
-  // Function / number keys
-  KF_1, // 1, F1
-  KF_2, // 2, F2
-  KF_3, // ...
-  KF_4,
-  KF_5,
-  KF_6,
-  KF_7,
-  KF_8,
-  KF_9,
-  KF_10,
-
   // Application select keys
   APP_SLK, // Slack
   APP_EMCS, // Emacs
@@ -55,17 +42,6 @@ enum {
   APP_CHRM, // Chrome
   APP_MSIC, // Music
 
-  // Diagonal mouse movement
-  A_MUL,
-  A_MUR,
-  A_MDL,
-  A_MDR,
-
-  // Mouse acceleration
-  A_ACL0,
-  A_ACL1,
-  A_ACL2,
-
   // Hungarian layer keys
   HU_AA, // Á
   HU_OO, // Ó
@@ -76,6 +52,18 @@ enum {
   HU_UE, // Ü
   HU_OEE, // Ő
   HU_UEE, // Ű
+
+  // number/symbol keys
+  A_1, // 1
+  A_2, // 2
+  A_3, // ...
+  A_4,
+  A_5,
+  A_6,
+  A_7,
+  A_8,
+  A_9,
+  A_0,
 };
 
 /* Fn keys */
@@ -95,7 +83,9 @@ enum {
   CT_CLN = 0,
   CT_TA,
   CT_LBP,
-  CT_RBP
+  CT_RBP,
+  CT_TMUX,
+  CT_TPS,
 };
 
 /* States & timers */
@@ -114,6 +104,8 @@ bool log_enable = false;
 
 bool time_travel = false;
 
+static uint8_t is_adore = 0;
+
 /* The Keymap */
 
 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
@@ -121,13 +113,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
 /* Keymap 0: Base Layer
  *
  * ,-----------------------------------------------------.           ,-----------------------------------------------------.
- * | Next/Prev | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr |           |  F12 | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10|       F11 |
+ * | Next/Prev | 9    | 7  @ | 5  * | 3  ^ | 1  $ | F11  |           |  F12 | 0  % | 2  ! | 4  # | 6  & | 8    |    Plover |
  * |-----------+------+------+------+------+-------------|           |------+------+------+------+------+------+-----------|
  * |         ~ |   '  |   ,  |   .  |   P  |   Y  |   (  |           |  )   |   F  |   G  |   C  |   R  |  L   | \         |
  * |-----------+------+------+------+------+------|   [  |           |  ]   |------+------+------+------+------+-----------|
  * | Tab/ARROW |   A  |   O  |   E  |   U  |   I  |------|           |------|   D  |   H  |   T  |   N  |  S   | = / Arrow |
- * |-----------+------+------+------+------+------|   :  |           |  -   |------+------+------+------+------+-----------|
- * | Play/Pause|   /  |   Q  |   J  |   K  |   X  |      |           |      |   B  |   M  |   W  |   V  |  Z   |      Stop |
+ * |-----------+------+------+------+------+------| tmux |           | tmux |------+------+------+------+------+-----------|
+ * | Play/Pause|   /  |   Q  |   J  |   K  |   X  |      |           | Pane |   B  |   M  |   W  |   V  |  Z   |      Stop |
  * `-----------+------+------+------+------+-------------'           `-------------+------+------+------+------+-----------'
  *     |       |      |      |      |   :  |                                       |   -  |      |      |      |       |
  *     `-----------------------------------'                                       `-----------------------------------'
@@ -141,22 +133,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  */
 [BASE] = KEYMAP(
 // left hand
- M(A_MPN)           ,M(KF_1)     ,M(KF_2)     ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR)
-,KC_GRV             ,KC_QUOT     ,KC_COMM     ,KC_DOT ,KC_P   ,KC_Y   ,TD(CT_LBP)
-,TD(CT_TA)          ,KC_A        ,KC_O        ,KC_E   ,KC_U   ,KC_I
-,KC_MPLY            ,KC_SLSH     ,KC_Q        ,KC_J   ,KC_K   ,KC_X   ,TD(CT_CLN)
-,KC_NO              ,KC_NO       ,KC_NO       ,KC_NO  ,TD(CT_CLN)
+ M(A_MPN)           ,M(A_9)      ,M(A_7)      ,M(A_5)  ,M(A_3)  ,M(A_1)  ,KC_F11
+,KC_GRV             ,KC_QUOT     ,KC_COMM     ,KC_DOT  ,KC_P    ,KC_Y    ,TD(CT_LBP)
+,TD(CT_TA)          ,KC_A        ,KC_O        ,KC_E    ,KC_U    ,KC_I
+,KC_MPLY            ,KC_SLSH     ,KC_Q        ,KC_J    ,KC_K    ,KC_X    ,TD(CT_TMUX)
+,KC_NO              ,KC_NO       ,KC_NO       ,KC_NO   ,TD(CT_CLN)
 
                                                             ,F(F_ALT),F(F_GUI)
                                                                      ,F(F_CTRL)
                                                     ,KC_BSPC,F(F_SFT),KC_ESC
 
                                                                 // right hand
-                                                               ,KC_F12    ,M(KF_6),M(KF_7)   ,M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11
-                                                               ,TD(CT_RBP),KC_F   ,KC_G      ,KC_C   ,KC_R    ,KC_L     ,KC_BSLS
-                                                                          ,KC_D   ,KC_H      ,KC_T   ,KC_N    ,KC_S     ,KC_EQL
-                                                               ,KC_MINS   ,KC_B   ,KC_M      ,KC_W   ,KC_V    ,KC_Z     ,KC_MSTP
-                                                                                  ,KC_MINS   ,KC_NO  ,KC_NO   ,KC_NO    ,KC_NO
+                                                               ,KC_F12    ,M(A_0)  ,M(A_2)    ,M(A_4)  ,M(A_6)  ,M(A_8)   ,M(A_PLVR)
+                                                               ,TD(CT_RBP),KC_F    ,KC_G      ,KC_C    ,KC_R    ,KC_L     ,KC_BSLS
+                                                                          ,KC_D    ,KC_H      ,KC_T    ,KC_N    ,KC_S     ,KC_EQL
+                                                               ,TD(CT_TPS),KC_B    ,KC_M      ,KC_W    ,KC_V    ,KC_Z     ,KC_MSTP
+                                                                                   ,KC_MINS   ,KC_NO   ,KC_NO   ,KC_NO    ,KC_NO
 
                                                                ,OSL(NMDIA),KC_DEL
                                                                ,KC_LEAD
@@ -166,15 +158,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
 /* Keymap 1: Adore layer
  *
  * ,-----------------------------------------------------.           ,-----------------------------------------------------.
- * | Play/Pause| 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr |           |  F12 | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10|       F11 |
+ * | Play/Pause| 9    | 7  @ | 5  * | 3  ^ | 1  $ | F11  |           |  F12 | 0  % | 2  ! | 4  # | 6  & | 8    |    Plover |
  * |-----------+------+------+------+------+-------------|           |------+------+------+------+------+------+-----------|
- * |        `~ |   Y  |   W  |   G  |   L  |   M  |   (  |           |  )   |   F  |   H  |   C  |   P  |  X   | \         |
+ * |        `~ |   X  |   W  |   G  |   L  |   M  |   (  |           |  )   |   F  |   H  |   C  |   P  |  Y   | \         |
  * |-----------+------+------+------+------+------|   [  |           |  ]   |------+------+------+------+------+-----------|
  * | Tab/Arrow |   A  |   O  |   E  |   I  |   U  |------|           |------|   D  |   R  |   T  |   N  |  S   | =         |
- * |-----------+------+------+------+------+------|      |           |      |------+------+------+------+------+-----------|
- * |           |   Z  |   Q  |   '  |   ,  |   .  |   :  |           |  -   |   B  |   K  |   V  |   J  |  /   |           |
+ * |-----------+------+------+------+------+------| tmux |           | tmux |------+------+------+------+------+-----------|
+ * |           |   Z  |   Q  |   '  |   ,  |   .  |      |           | pane |   B  |   K  |   V  |   J  |  /   |           |
  * `-----------+------+------+------+------+-------------'           `-------------+------+------+------+------+-----------'
- *     |       |      |      |      |      |                                       |      |      |      |      |       |
+ *     |       |      |      |      |   :  |                                       |   -  |      |      |      |       |
  *     `-----------------------------------'                                       `-----------------------------------'
  *                                         ,-------------.           ,-------------.
  *                                         | LAlt | GUI  |           | MDIA | Del  |
@@ -186,22 +178,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  */
 [ADORE] = KEYMAP(
 // left hand
- KC_MPLY            ,M(KF_1)     ,M(KF_2)     ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR)
-,KC_GRV             ,KC_Y        ,KC_W        ,KC_G   ,KC_L   ,KC_M   ,TD(CT_LBP)
-,TD(CT_TA)          ,KC_A        ,KC_O        ,KC_E   ,KC_I   ,KC_U
-,KC_NO              ,KC_Z        ,KC_Q        ,KC_QUOT,KC_COMM,KC_DOT ,TD(CT_CLN)
-,KC_NO              ,KC_NO       ,KC_NO       ,KC_NO  ,KC_NO
+ KC_MPLY            ,M(A_9)      ,M(A_7)      ,M(A_5)  ,M(A_3)  ,M(A_1) ,KC_F11
+,KC_GRV             ,KC_X        ,KC_W        ,KC_G    ,KC_L    ,KC_M   ,TD(CT_LBP)
+,TD(CT_TA)          ,KC_A        ,KC_O        ,KC_E    ,KC_I    ,KC_U
+,KC_NO              ,KC_Z        ,KC_Q        ,KC_QUOT ,KC_COMM ,KC_DOT ,TD(CT_TMUX)
+,KC_NO              ,KC_NO       ,KC_NO       ,KC_NO   ,TD(CT_CLN)
 
                                                             ,F(F_ALT),F(F_GUI)
                                                                      ,F(F_CTRL)
                                                     ,KC_BSPC,F(F_SFT),KC_ESC
 
                                                                 // right hand
-                                                               ,KC_F12    ,M(KF_6),M(KF_7),M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11
-                                                               ,TD(CT_RBP),KC_F   ,KC_H   ,KC_C   ,KC_P    ,KC_X     ,KC_BSLS
-                                                                          ,KC_D   ,KC_R   ,KC_T   ,KC_N    ,KC_S     ,KC_EQL
-                                                               ,KC_MINS   ,KC_B   ,KC_K   ,KC_V   ,KC_J    ,KC_SLSH  ,KC_NO
-                                                                                  ,KC_NO  ,KC_NO  ,KC_NO   ,KC_NO    ,KC_NO
+                                                               ,KC_F12    ,M(A_0)   ,M(A_2)  ,M(A_4)  ,M(A_6)  ,M(A_8)  ,M(A_PLVR)
+                                                               ,TD(CT_RBP),KC_F     ,KC_H    ,KC_C    ,KC_P    ,KC_Y    ,KC_BSLS
+                                                                          ,KC_D     ,KC_R    ,KC_T    ,KC_N    ,KC_S    ,KC_EQL
+                                                               ,TD(CT_TPS),KC_B     ,KC_K    ,KC_V    ,KC_J    ,KC_SLSH ,KC_NO
+                                                                                    ,KC_MINS ,KC_NO   ,KC_NO   ,KC_NO   ,KC_NO
 
                                                                ,OSL(NMDIA),KC_DEL
                                                                ,F(F_HUN)
@@ -350,45 +342,45 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
 /* Keymap 5: Navigation & Media layer
  *
  * ,-----------------------------------------------------.           ,-----------------------------------------------------.
- * | MS Slow   |      |      |      |      |      |ScrLCK|           |ScrLCK|      |      |      |      |      |           |
+ * |           |  F9  |  F7  |  F5  |  F3  |  F1  |      |           |ScrLCK| F10  |  F2  |  F4  |  F6  |  F8  |           |
  * |-----------+------+------+------+------+-------------|           |------+------+------+------+------+------+-----------|
- * | MS Normal |      | Home |  Up  | PgUp |      |      |           |Scroll|      |MsUpL | MsUp |MsUpR |      |PrintScreen|
- * |-----------+------+------+------+------+------|      |           |  Up  |------+------+------+------+------+-----------|
- * | MS Fast   |      | Left | Down | Right|      |------|           |------|      |MsLeft| MsDn |MsRght|      |           |
- * |-----------+------+------+------+------+------|      |           |Scroll|------+------+------+------+------+-----------|
- * | Play/Pause|      | End  | Down | PgDn |      |      |           | Down |      |MsDnL | MsDn |MsDnR |      |      Stop |
+ * |           |      |      |      |      |      |      |           |      |      |      |      |      |      |           |
+ * |-----------+------+------+------+------+------|      |           |      |------+------+------+------+------+-----------|
+ * |           |      |      |      |      |      |------|           |------|      |      |      |      |      |           |
+ * |-----------+------+------+------+------+------|      |           |      |------+------+------+------+------+-----------|
+ * |           |      |      |      |      |      |      |           |      |      |      |      |      |      |           |
  * `-----------+------+------+------+------+-------------'           `-------------+------+------+------+------+-----------'
  *      |      |      |      |      |      |                                       |      |      |      |      |      |
  *      `----------------------------------'                                       `----------------------------------'
  *                                         ,-------------.           ,-------------.
- *                                         | Mute | VlUp |           | BASE | MClk |
+ *                                         | Mute | VlUp |           | BASE |      |
  *                                  ,------|------|------|           |------+------+------.
- *                                  |      |      | VlDn |           | Prev |Left  |Right |
- *                                  |  SPC | Enter|------|           |------| Click| Click|
- *                                  |      |      | ESC  |           | Next |      |      |
+ *                                  |      |      | VlDn |           |      |      |      |
+ *                                  |      |      |------|           |------|      |      |
+ *                                  |      |      |      |           |      |      |      |
  *                                  `--------------------'           `--------------------'
  */
 [NMDIA] = KEYMAP(
 // left hand
- M(A_ACL0)  ,KC_NO       ,KC_NO      ,KC_NO   ,KC_NO   ,KC_NO   ,LGUI(KC_L)
-,M(A_ACL1)  ,KC_NO       ,KC_HOME    ,KC_UP   ,KC_PGUP ,KC_NO   ,KC_NO
-,M(A_ACL2)  ,KC_NO       ,KC_LEFT    ,KC_DOWN ,KC_RIGHT,KC_NO
-,KC_MPLY    ,KC_NO       ,KC_END     ,KC_DOWN ,KC_PGDN ,KC_NO   ,KC_NO
+ KC_NO      ,KC_F9       ,KC_F7      ,KC_F5   ,KC_F3   ,KC_F1   ,KC_NO
+,KC_NO      ,KC_NO       ,KC_NO      ,KC_NO   ,KC_NO   ,KC_NO   ,KC_NO
+,KC_NO      ,KC_NO       ,KC_NO      ,KC_NO   ,KC_NO   ,KC_NO
+,KC_NO      ,KC_NO       ,KC_NO      ,KC_NO   ,KC_NO   ,KC_NO   ,KC_NO
 ,KC_NO      ,KC_NO       ,KC_NO      ,KC_NO   ,KC_NO
                                                         ,KC_MUTE ,KC_VOLU
                                                                  ,KC_VOLD
-                                                 ,KC_SPC,KC_ENTER,KC_ESC
+                                                 ,KC_NO ,KC_NO   ,KC_TRNS
 
                                                                      // right hand
-                                                                     ,LGUI(KC_L),KC_NO   ,KC_NO   ,KC_NO   ,KC_NO   ,KC_NO    ,KC_NO
-                                                                     ,KC_WH_U   ,KC_NO   ,M(A_MUL),KC_MS_U ,M(A_MUR),KC_NO    ,KC_PSCR
-                                                                                ,KC_NO   ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_NO    ,KC_NO
-                                                                     ,KC_WH_D   ,KC_NO   ,M(A_MDL),KC_MS_D ,M(A_MDR),KC_NO    ,KC_MSTP
+                                                                     ,LGUI(KC_L),KC_F10  ,KC_F2   ,KC_F4   ,KC_F6   ,KC_F8    ,KC_NO
+                                                                     ,KC_NO     ,KC_NO   ,KC_NO   ,KC_NO   ,KC_NO   ,KC_NO    ,KC_NO
+                                                                                ,KC_NO   ,KC_NO   ,KC_NO   ,KC_NO   ,KC_NO    ,KC_NO
+                                                                     ,KC_NO     ,KC_NO   ,KC_NO   ,KC_NO   ,KC_NO   ,KC_NO    ,KC_NO
                                                                                          ,KC_NO   ,KC_NO   ,KC_NO   ,KC_NO    ,KC_NO
 
-                                                                     ,KC_TRNS   ,KC_MS_BTN3
-                                                                     ,KC_MPRV
-                                                                     ,KC_MNXT   ,KC_BTN1 ,KC_BTN2
+                                                                     ,KC_TRNS   ,KC_NO
+                                                                     ,KC_NO
+                                                                     ,KC_NO     ,KC_NO   ,KC_NO
     ),
 
 /* Keymap 6: Steno for Plover
@@ -514,40 +506,62 @@ static macro_t *ang_do_hun (keyrecord_t *record, uint16_t accent, uint16_t hun_c
   return MACRO_NONE;
 }
 
-static bool from_appsel;
+static void ang_handle_num_row(uint8_t id, keyrecord_t *record) {
+  uint8_t idx = id - A_1;
+  uint8_t kc;
+  static bool shifted[10];
 
-static void ang_handle_kf (keyrecord_t *record, uint8_t id)
-{
-  uint8_t code = id - KF_1;
+  if (keyboard_report->mods & MOD_BIT(KC_LSFT) ||
+      ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out())) {
+    if (record->event.pressed)
+      shifted[idx] = true;
+  }
 
-  if (record->event.pressed) {
-    kf_timers[code] = timer_read ();
+  if (!shifted[idx]) {
+    kc = idx + KC_1;
   } else {
-    uint8_t kc_base;
-
-    if (from_appsel) {
-      from_appsel = false;
+    switch (id) {
+    case A_8:
+    case A_9:
+      shifted[idx] = false;
       return;
-    }
 
-    if (kf_timers[code] && timer_elapsed (kf_timers[code]) > TAPPING_TERM) {
-      // Long press
-      kc_base = KC_F1;
-    } else {
-      kc_base = KC_1;
+    case A_7:
+      kc = KC_2;
+      break;
+    case A_5:
+      kc = KC_8;
+      break;
+    case A_3:
+      kc = KC_6;
+      break;
+    case A_1:
+      kc = KC_4;
+      break;
+
+    case A_0:
+      kc = KC_5;
+      break;
+    case A_2:
+      kc = KC_1;
+      break;
+    case A_4:
+      kc = KC_3;
+      break;
+    case A_6:
+      kc = KC_7;
+      break;
     }
-    kf_timers[code] = 0;
-    code += kc_base;
+  }
 
-    register_code (code);
-    unregister_code (code);
+  if (record->event.pressed) {
+    register_code (kc);
+  } else {
+    unregister_code (kc);
+    shifted[idx] = false;
   }
 }
 
-static struct {
-  uint8_t idx;
-} m_accel_state;
-
 const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
 {
       switch(id) {
@@ -592,70 +606,6 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
       case HU_UEE:
         return ang_do_hun (record, KC_EQL, KC_U);
 
-#if MOUSEKEY_ENABLE
-        /* Mouse movement */
-      case A_MUL:
-        if (record->event.pressed) {
-          mousekey_on(KC_MS_UP);
-          mousekey_on(KC_MS_LEFT);
-        } else {
-          mousekey_off(KC_MS_UP);
-          mousekey_off(KC_MS_LEFT);
-        }
-        mousekey_send();
-        break;
-
-      case A_MUR:
-        if (record->event.pressed) {
-          mousekey_on(KC_MS_UP);
-          mousekey_on(KC_MS_RIGHT);
-        } else {
-          mousekey_off(KC_MS_UP);
-          mousekey_off(KC_MS_RIGHT);
-        }
-        mousekey_send();
-        break;
-
-      case A_MDL:
-        if (record->event.pressed) {
-          mousekey_on(KC_MS_DOWN);
-          mousekey_on(KC_MS_LEFT);
-        } else {
-          mousekey_off(KC_MS_DOWN);
-          mousekey_off(KC_MS_LEFT);
-        }
-        mousekey_send();
-        break;
-
-      case A_MDR:
-        if (record->event.pressed) {
-          mousekey_on(KC_MS_DOWN);
-          mousekey_on(KC_MS_RIGHT);
-        } else {
-          mousekey_off(KC_MS_DOWN);
-          mousekey_off(KC_MS_RIGHT);
-        }
-        mousekey_send();
-        break;
-
-      case A_ACL0 ... A_ACL2:
-        if (record->event.pressed) {
-          uint8_t idx = id - A_ACL0;
-          if (m_accel_state.idx == id) {
-            mousekey_off(m_accel_state.idx - A_ACL0 + KC_ACL0);
-            m_accel_state.idx = 0;
-          } else {
-            if (m_accel_state.idx) {
-              mousekey_off(m_accel_state.idx - A_ACL0 + KC_ACL0);
-              m_accel_state.idx = 0;
-            }
-            mousekey_on(KC_ACL0 + idx);
-            m_accel_state.idx = id;
-          }
-        }
-        break;
-#endif
-
         /* Plover base */
       case A_PLVR:
         toggle_steno(record->event.pressed);
@@ -667,7 +617,6 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
           register_code (KC_LGUI);
           if (record->tap.count && !record->tap.interrupted) {
             if (record->tap.count >= 2) {
-              register_code (KC_W);
               layer_on (APPSEL);
               set_oneshot_layer (APPSEL, ONESHOT_START);
             }
@@ -678,7 +627,6 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
         } else {
           if (record->tap.count >= 2)
             {
-              unregister_code (KC_W);
               clear_oneshot_layer_state (ONESHOT_PRESSED);
             }
           gui_timer = timer_read ();
@@ -686,43 +634,39 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
         break;
 
       case APP_SLK:
-        from_appsel = true;
-        return MACRODOWN(T(S), T(L), T(A), T(C), T(K), T(ENT), END);
+        if (record->event.pressed)
+          uprintf("CMD:appsel_slack\n");
+        break;
 
       case APP_EMCS:
-        from_appsel = true;
-        return MACRODOWN(T(G), T(N), T(U), T(SPC), T(E), T(M), T(A), T(C), T(S), T(SPC), T(2), T(4), T(ENT), END);
+        if (record->event.pressed)
+          uprintf("CMD:appsel_emacs\n");
+        break;
 
       case APP_TERM:
-        from_appsel = true;
-        if (!record->event.pressed) {
-          register_code(KC_ESC);
-          unregister_code(KC_ESC);
-          wait_ms(TAPPING_TERM + 25);
-          register_code(KC_DEL);
-          unregister_code(KC_DEL);
-        }
+        if (record->event.pressed)
+          uprintf("CMD:appsel_term\n");
         break;
 
       case APP_CHRM:
-        from_appsel = true;
-        return MACRODOWN(T(C), T(H), T(R), T(O), T(M), T(ENT), END);
+        if (record->event.pressed)
+          uprintf("CMD:appsel_chrome\n");
+        break;
 
       case APP_MSIC:
-        from_appsel = true;
-        return MACRODOWN(T(R), T(H), T(Y), T(T), T(H), T(M), T(B), T(O), T(X), T(ENT), END);
+        if (record->event.pressed)
+          uprintf("CMD:appsel_music\n");
+        break;
 
-        /* Function keys */
-      case KF_1 ... KF_10:
-        ang_handle_kf (record, id);
+        // number row and symbols
+      case A_1 ... A_0:
+        ang_handle_num_row(id, record);
         break;
       }
 
       return MACRO_NONE;
 };
 
-static uint8_t is_adore = 0;
-
 // Runs just one time when the keyboard initializes.
 void matrix_init_user(void) {
   uint8_t dl;
@@ -805,6 +749,36 @@ static void ang_tap_dance_ta_reset (qk_tap_dance_state_t *state, void *user_data
     layer_off (ARRW);
 }
 
+static void ang_tap_dance_tmux_finished (qk_tap_dance_state_t *state, void *user_data) {
+  if (state->count == 1) {
+    register_code(KC_LALT);
+    register_code(KC_SPC);
+    unregister_code(KC_SPC);
+    unregister_code(KC_LALT);
+  } else {
+    register_code(KC_LCTL);
+    register_code(KC_A);
+    unregister_code(KC_A);
+    unregister_code(KC_LCTL);
+  }
+}
+
+static void ang_tap_dance_tmux_pane_select (qk_tap_dance_state_t *state, void *user_data) {
+  uint8_t kc = KC_P;
+
+  if (state->count >= 2) {
+    kc = KC_Z;
+  }
+  
+  register_code(KC_LALT);
+  register_code(KC_SPC);
+  unregister_code(KC_SPC);
+  unregister_code(KC_LALT);
+
+  register_code(kc);
+  unregister_code(kc);
+}
+
 qk_tap_dance_action_t tap_dance_actions[] = {
    [CT_CLN] = ACTION_TAP_DANCE_DOUBLE (KC_COLN, KC_SCLN)
   ,[CT_TA]  = {
@@ -813,12 +787,23 @@ qk_tap_dance_action_t tap_dance_actions[] = {
    }
   ,[CT_LBP] = ACTION_TAP_DANCE_DOUBLE (KC_LBRC, KC_LPRN)
   ,[CT_RBP] = ACTION_TAP_DANCE_DOUBLE (KC_RBRC, KC_RPRN)
+  ,[CT_TMUX]= ACTION_TAP_DANCE_FN (ang_tap_dance_tmux_finished)
+  ,[CT_TPS] = ACTION_TAP_DANCE_FN (ang_tap_dance_tmux_pane_select)
 };
 
 // Runs constantly in the background, in a loop.
 void matrix_scan_user(void) {
+  static uint32_t prev_layer_state;
   uint8_t layer = biton32(layer_state);
   bool is_arrow = false;
+  static char *layer_lookup[] = {"Dvorak", "ADORE", "Arrows", "AppSel", "Hungarian", "Nav/Media", "Plover"};
+
+  if (layer_state != prev_layer_state) {
+    prev_layer_state = layer_state;
+    if (layer_lookup[layer])
+      uprintf("LAYER: %s\n", layer_lookup[layer]);
+  }
+
 
   if (gui_timer && timer_elapsed (gui_timer) > TAPPING_TERM)
     unregister_code (KC_LGUI);
@@ -929,18 +914,7 @@ void matrix_scan_user(void) {
     }
 
     SEQ_TWO_KEYS (KC_W, KC_M) {
-      register_code (KC_LALT);
-      register_code (KC_F2);
-      unregister_code (KC_F2);
-      unregister_code (KC_LALT);
-
-      wait_ms (1000);
-
-      ang_tap (KC_M, KC_A, KC_X, KC_MINS, KC_F, KC_O, KC_C, KC_U, KC_S, KC_E, KC_D, KC_ENT, 0);
-      register_code (KC_LGUI);
-      register_code (KC_UP);
-      unregister_code (KC_UP);
-      unregister_code (KC_LGUI);
+      uprintf("CMD:wm\n");
     }
 
     SEQ_ONE_KEY (KC_A) {
@@ -999,8 +973,11 @@ const qk_ucis_symbol_t ucis_symbol_table[] = UCIS_TABLE
 bool process_record_user (uint16_t keycode, keyrecord_t *record) {
 #if KEYLOGGER_ENABLE
   if (log_enable) {
-    xprintf ("KL: col=%02d, row=%02d, pressed=%d, layer=%s\n", record->event.key.col,
-             record->event.key.row, record->event.pressed, (is_adore) ? "ADORE" : "Dvorak");
+    uint8_t layer = biton32(layer_state);
+
+    if ((layer == ADORE) || (layer == BASE))
+      uprintf ("KL: col=%02d, row=%02d, pressed=%d, layer=%s\n", record->event.key.col,
+               record->event.key.row, record->event.pressed, (is_adore) ? "ADORE" : "Dvorak");
   }
 #endif
 
@@ -1047,8 +1024,8 @@ void qk_ucis_symbol_fallback (void) {
   for (uint8_t i = 0; i < qk_ucis_state.count - 1; i++) {
     uint8_t code;
 
-    if (qk_ucis_state.codes[i] > KF_1)
-      code = qk_ucis_state.codes[i] - KF_1 + KC_1;
+    if ((qk_ucis_state.codes[i] >= M(A_1)) && (qk_ucis_state.codes[i] <= M(A_0)))
+      code = qk_ucis_state.codes[i] - M(A_1) + KC_1;
     else
       code = qk_ucis_state.codes[i];
     register_code(code);
index 5e7adb3320854bda5ebbbb27b789261a7ea96d07..f15b676528008d15901cf4866a7873f8296f1d23 100644 (file)
@@ -18,12 +18,11 @@ Some of the things in the layout only work when one uses [Spacemacs][spacemacs]
 * [Layouts](#layouts)
     - [Base layer](#base-layer)
     - [ADORE layer](#adore-layer)
-    - [Hungarian layer](#hungarian-layer)
-    - [Navigation and media layer](#navigation-and-media-layer)
     - [Steno layer](#steno-layer)
     - [LED states](#led-states)
 * [Tools](#tools)
     - [Heatmap](#heatmap)
+    - [Layer notification](#layer-notification)
 * [Special features](#special-features)
     - [Unicode Symbol Input](#unicode-symbol-input)
 * [Building](#building)
@@ -39,7 +38,7 @@ Some of the things in the layout only work when one uses [Spacemacs][spacemacs]
 
 At its core, this is a Dvorak layout, with some minor changes. The more interesting parts are how certain keys behave:
 
-* The keys on the number row double as function keys, when held for a bit longer than an usual tap. This allows me to use the function keys without having to switch layers.
+* The number row is the same as in the [ADORE](#adore-layer) layer. The function keys are on the **Media** layer.
 * The `Shift`, `Alt`, and `Control` modifiers are one-shot. When tapped, they are considered active for the next key press only. When double tapped, they toggle on, until a third, single tap sometime later. When held, they act as expected. My usual pattern is that I use these for the next keypress only, so this behaviour is perfect. If I need them held, I'll just double-tap.
 * The `GUI` key is special, because when I double-tap it, it sends `GUI + w`, which pops up an application selector. It also switches to a one-shot layer, where the number row on the left half turns into app selector macros, for the most common things I usually want to switch to. Otherwise it behaves as on a normal layout.
 * The `ESC` key also doubles as a one-shot cancel key: if tapped while any of the one-shot modifiers are in-flight (as in, single-tapped, and not expired yet), it cancels all one-shot modifiers. It also cancels the **Hun** layer, if active. Otherwise it sends the usual keycode.
@@ -57,28 +56,16 @@ At its core, this is a Dvorak layout, with some minor changes. The more interest
     - `LEAD d` toggles logging keypress positions to the HID console.
     - `LEAD t` toggles time travel. Figuring out the current `date` is left as an exercise to the reader.
     - `LEAD u` enters the [Unicode symbol input](#unicode-symbol-input) mode.
+    
+The symbols on the front in the image above have the same color as the key that activates them, with the exception of the **Arrow** layer, which is just black on the front.
 
 ## ADORE layer
 
 [![ADORE layer](images/adore-layer.png)](http://www.keyboard-layout-editor.com/#/gists/45681a17453d235925b6028dd83bf12a)
 
-While using the standard Dvorak layout, I encountered a number of inconveniences, and on this layer, I am playing with ideas to make the layout feel better. Initially, it was based on [Capewell-Dvorak][cpd], but that too, had shortcomings I was not happy with. So now this is something inbetween, with own observations thrown in. How it works out in the long run remains to be seen.
+My experimental layout, that I keep tweaking. No full description here, because things are very much in flux.
 
- [cpd]: http://www.michaelcapewell.com/projects/keyboard/layout_capewell-dvorak.htm
-Based on a week and a half of typing, the keys were rearranged, and the home row neatly spelled out **ADORE**, that gave the layout its name.
-
-## Hungarian layer
-
-[![Hungarian layer](images/hun-layer.png)](http://www.keyboard-layout-editor.com/#/gists/b160f6ec90d58c127c114c89f66e9dc9)
-
-On this layer, the accented characters are at the same position as their base variant. For some, which can have other diatribes, the long one is on top, short's on bottom. Tapping any of the accented characters takes us back to the base layer.
-
-## Navigation and media layer
-
-[![Navigation and media layer](images/nav-n-media-layer.png)](http://www.keyboard-layout-editor.com/#/gists/c59c453f9fe1a3238ba1494e7e5c6892)
-
-This layer is primarily for navigating with the cursor or the mouse, and some media things.
+Note that the **HUN** layer does not work well with ADORE: it still has the same layout as on the [Base](#base-layer) layer. This will remain until ADORE becomes the default.
 
 ## Steno layer
 
@@ -93,8 +80,8 @@ The primary purpose of the LEDs is to show the modifier status, a secondary, to
 For the layers, the following rules apply:
 
 * When the [ADORE layer](#adore-layer) is toggled on, LEDs will light up from left to right in a sequence, then turn off. When the layer is toggled off, the LEDs light up and turn off in the other direction. No LEDs are on while the layer is active.
-* When the [Hungarian layer](#hungarian-layer) is active, the *green* and *blue* LEDs are on.
-* When the [Navigation and media layer](#navigation-and-media-layer) is active, the *red* and *green* ones are on.
+* When the **Hungarian** layer is active, the *green* and *blue* LEDs are on.
+* When the **Media** layer is active, the *red* and *green* ones are on.
 * When the **ARROW** layer is active, the *red* and *blue* ones are on.
 * For the [Steno layer](#steno-layer), all LEDs will be turned on.
 
@@ -129,6 +116,10 @@ The generated heatmap looks somewhat like this:
 
  ![Heatmap](images/heatmap.png)
 
+## Layer notification
+
+There is a very small tool in `tools/layer-notify`, that listens to the HID console, looking for layer change events, and pops up a notification for every detected change. It is a very simple tool, mainly serving as an example.
+
 # Building
 
 To make my workflow easier, this layout is maintained in [its own repository][algernon:ez-layout]. To build it, you will need the [QMK][qmk] firmware checked out, and this repo either checked out to something like `keyboards/ergodox_ez/algernon-master`. One way to achieve that is this:
@@ -156,6 +147,43 @@ The keymap default to forcing NKRO, which seems to upset Windows, and except the
 
 # Changelog
 
+## v1.7
+
+*2016-09-18*
+
+### Overall changes
+
+* The number row has been completely rearranged on both the [Base](#base-layer) and the [ADORE](#adore-layer) layers.
+* The number/function key behavior was changed: function keys are now on the **Media**.
+* The `:`/`;` and `-`/`_` keys were put back to their thumb position on the bottom row, on both the [Base](#base-layer) and [ADORE](#adore-layer) layers.
+* The bottom large keys on the inner side of each half now function as [tmux](http://tmux.github.io/) keys: the left to send the prefix, the right to send the `display-panes` key. The left also doubles as a GNU screen prefix key, and sends `C-a` when double tapped.
+* A number of functions, such as the **AppSel** layer, now require the `hid-commands` tool to be running, with the output of `hid_listen` being piped to it.
+
+### ADORE
+
+* `Y` and `X` have been swapped again.
+
+### Media/Navigation layer
+
+* The function keys are now on this layer.
+* Mouse keys have been removed.
+* Media start/stop/prev/next have been removed.
+* `Print screen` has been removed.
+* There is only one screen lock key now.
+
+### Heatmap
+
+* Fixed a few issues in the finger-stats calculation.
+* The tool now also timestamps and saves all input lines to a logfile, which it loads on start, allowing one to continue the collection after upgrading the tool.
+* The heatmap tool will now colorize the stats by default.
+* The periodic stats are now printed in a more compact format.
+
+### Tools
+
+* Added a new tool, `tools/layer-notify` that listens to layer change events on the HID console, and pops up a notification on layer changes.
+* Another new tool, `tools/text-to-log.py` has been added that converts arbitrary text to a keylogger output, which can be fed to the heatmap generator.
+* A number of features have been moved to the `tools/hid-commands` utility. These generally are OS dependent, and are easier to implement on the software side.
+
 ## v1.6
 
 *2016-08-24*
@@ -174,7 +202,7 @@ The keymap default to forcing NKRO, which seems to upset Windows, and except the
 ### Miscellaneous changes
 
 * `LEAD u` now starts the symbolic unicode input system, instead of the OS-one.
-* The mouse acceleration keys on the [Navigation and Media](#navigation-and-media-layer) layer have been turned into toggles: tap them once to turn them on, until tapped again. Tapping an accelerator button will turn all the others off.
+* The mouse acceleration keys on the **Navigation/Media** layer have been turned into toggles: tap them once to turn them on, until tapped again. Tapping an accelerator button will turn all the others off.
 * When the **ARROW** layer is on, the *red* and *blue* LEDs light up now.
 
 ### Heatmap
@@ -221,7 +249,7 @@ The keymap default to forcing NKRO, which seems to upset Windows, and except the
 * The `:;` key has changed behaviour: to access the `;` symbol, the key needs to be double-tapped, instead of shifted.
 * The `=` and `\` keys were swapped, `=` moved to the home row, on both the [base](#base-layer) and the **experimental** layers.
 * The arrow and navigation keys were redone, they are now more accessible, but the navigation keys require an extra tap to access.
-* The **Emacs** layer is gone, replaced by a simplified [navigation and media](#navigation-and-media-layer) layer.
+* The **Emacs** layer is gone, replaced by a simplified **navigation and media** layer.
 * `LEAD v` types the firmware version, and the keymap version.
 * On the **experimental** layer, the `L` and `Q`, and the `K` and `G` keys were swapped.
 * The [Steno](#steno-layer) layer gained a few more `#` and `*` keys, to make it easier on my fingers.
@@ -240,7 +268,7 @@ The keymap default to forcing NKRO, which seems to upset Windows, and except the
     - `-` on the left half was replaced by `Tab`.
     - `Tab`'s original position is taken by a `Media Next`/`Media Prev` key.
     - `:` now inputs `;` when shifted.
-* `ESC` cancels the [Hungarian](#hungarian-layer) layer too, not just modifiers.
+* `ESC` cancels the **Hungarian** layer too, not just modifiers.
 
 ## v1.0
 
index 4dfa877a786f8240b5aa820707e17b7b331a6278..502d1e6ea42caf428404768a7fd1f76e0ed8720f 100644 (file)
   [
     {
       "x": 3.5,
-      "c": "#a7d0db",
       "fa": [
         0,
         0,
         2
       ]
     },
-    "#\n3\nF3",
+    "*\n5\nF5",
     {
       "x": 10.5,
-      "c": "#a7d0db",
-      "t": "#000000",
       "a": 4,
       "fa": [
         0,
         2
       ]
     },
-    "*\n8\nF8"
+    "#\n4\nF4"
   ],
   [
     {
       "y": -0.875,
-      "x": 2.5,
-      "c": "#bfbad1",
-      "t": "#0d0d0b"
+      "x": 2.5
     },
-    "@\n2\nF2",
+    "@\n7\nF7",
     {
-      "x": 1,
-      "c": "#7adabd",
-      "t": "#000000"
+      "x": 1
     },
-    "$\n4\nF4",
+    "^\n3\nF3",
     {
       "x": 8.5
     },
-    "&\n7\nF7",
+    "!\n2\nF2",
     {
-      "x": 1,
-      "c": "#bfbad1",
-      "t": "#0d0d0b"
+      "x": 1
     },
-    "(\n9\nF9"
+    "&\n6\nF6"
   ],
   [
     {
       "y": -0.875,
-      "x": 5.5,
-      "c": "#7adabd",
-      "t": "#000000"
+      "x": 5.5
     },
-    "%\n5\nF5",
+    "$\n1\nF1",
     {
-      "c": "#f9cd31",
       "a": 7,
-      "f": 2
+      "f": 3
     },
-    "STENO",
+    "F11",
     {
       "x": 4.5,
       "f": 3
     },
     "F12",
     {
-      "c": "#7adabd",
       "a": 4,
       "f": 3,
       "fa": [
         2
       ]
     },
-    "^\n6\nF6"
+    "%\n0\nF10"
   ],
   [
     {
       "y": -0.875,
-      "c": "#ffb2d2",
       "f": 9,
       "a": 6,
       "w": 1.5
     },
     "\n\n<i class='kb kb-Multimedia-Play-Pause'></i>",
     {
-      "t": "#0d0d0b",
       "f": 3,
       "a": 4,
       "fa": [
           2
       ]
     },
-    "!\n1\nF1",
+    " \n9\nF9",
     {
       "x": 14.5
     },
-    ")\n0\nF10",
+    " \n8\nF8",
     {
       "a": 7,
       "w": 1.5
     },
-    "F11"
+    "STENO"
   ],
   [
     {
       "y": -0.375,
       "x": 3.5,
-      "c": "#a7d0db",
-      "t": "#000000",
       "a": 6
     },
     "G",
     {
       "y": -0.875,
       "x": 2.5,
-      "c": "#bfbad1",
-      "t": "#0d0d0b",
       "a": 6
     },
     "W",
     {
       "x": 1,
-      "c": "#7adabd",
-      "t": "#000000",
       "a": 6
     },
     "L",
     },
     "H",
     {
-      "x": 1,
-      "c": "#bfbad1",
-      "t": "#0d0d0b"
+      "x": 1
     },
     "P"
   ],
   [
     {
       "y": -0.875,
-      "x": 5.5,
-      "c": "#7adabd",
-      "t": "#000000"
+      "x": 5.5
     },
     "M",
     {
-      "c": "#93c9b7",
       "a": 4,
       "fa": [0, 0, 0],
       "h": 1.5
     },
     "}\n)\n]",
     {
-      "c": "#7adabd",
       "a": 6
     },
     "F"
   [
     {
       "y": -0.875,
-      "c": "#ffb07b",
-      "t": "#0d0d0b",
       "f": 3,
       "a": 4,
       "w": 1.5
     },
     "\n\n~\n`",
     {
-      "c": "#ffb2d2",
       "a": 6,
       "f": 3
     },
-    "Y",
+    "X",
     {
       "x": 14.5,
       "a": 6
     },
-    "X",
+    "Y",
     {
       "a": 4,
       "w": 1.5
     {
       "y": -0.375,
       "x": 3.5,
-      "c": "#a7d0db",
-      "t": "#000000",
       "a": 6
     },
     "E",
   [
     {
       "y": -0.875,
-      "x": 2.5,
-      "c": "#bfbad1",
-      "t": "#0d0d0b"
+      "x": 2.5
     },
     "O",
     {
       "x": 1,
-      "c": "#7adabd",
-      "t": "#000000",
       "n": true
     },
     "I",
     },
     "R",
     {
-      "x": 1,
-      "c": "#bfbad1",
-      "t": "#0d0d0b"
+      "x": 1
     },
     "N"
   ],
   [
     {
       "y": -0.875,
-      "x": 5.5,
-      "c": "#7adabd",
-      "t": "#000000"
+      "x": 5.5
     },
     "U",
     {
   [
     {
       "y": -0.875,
-      "c": "#ffb2d2",
-      "t": "#0d0d0b",
       "fa": [
         6
       ],
     {
       "y": -0.625,
       "x": 6.5,
-      "c": "#93c9b7",
-      "t": "#000000",
+      "a": 7,
+      "f": 9,
       "h": 1.5
     },
-    ";\n:",
+    "<i class='fa fa-columns'></i>",
     {
       "x": 4.5,
       "h": 1.5
     },
-    "_\n-"
+    "<i class='fa fa-table'></i>"
   ],
   [
     {
       "y": -0.75,
       "x": 3.5,
-      "c": "#a7d0db",
       "a": 4,
       "f": 3
     },
     {
       "y": -0.875,
       "x": 2.5,
-      "c": "#bfbad1",
-      "t": "#0d0d0b",
       "a": 6
     },
     "Q",
     {
       "x": 1,
-      "c": "#7adabd",
-      "t": "#000000",
       "a": 4
     },
     "<\n,",
     },
     "K",
     {
-      "x": 1,
-      "c": "#bfbad1",
-      "t": "#0d0d0b"
+      "x": 1
     },
     "J"
   ],
     {
       "y": -0.875,
       "x": 5.5,
-      "c": "#7adabd",
-      "t": "#000000",
       "a": 4
     },
     ">\n.",
   [
     {
       "y": -0.875,
-      "c": "#ffb07b",
       "f": 9,
       "w": 1.5,
       "g": true
     },
     "",
     {
-      "c": "#ffb2d2",
-      "t": "#0d0d0b",
       "a": 6,
       "f": 3,
       "g": false
     },
     "?\n/",
     {
-      "c": "#ffb07b",
-      "t": "#000000",
       "f": 9,
       "g": true,
       "w": 1.5,
     {
       "y": -0.375,
       "x": 3.5,
-      "c": "#d9dae0",
       "g": true,
       "a": 7,
       "f": 3
     "",
     {
       "x": 1,
-      "c": "#d4872a",
-      "g": true,
+      "g": false,
       "a": 5
     },
-    "",
+    ";\n:",
     {
       "x": 8.5
     },
-    "",
+    "_\n-",
     {
       "x": 1,
-      "c": "#d9dae0",
       "g": true,
       "a": 7
     },
       "ry": 4.25,
       "y": -1,
       "x": 1,
-      "c": "#f9cd31",
       "g": false
     },
     "Alt",
   ],
   [
     {
-      "c": "#d4872a",
       "a": 7,
       "f": 9,
       "h": 2
     },
     "<i class='fa fa-angle-double-up'></i>",
     {
-      "c": "#f9cd31",
       "f": 3
     },
     "Ctrl"
   ],
   [
     {
-      "x": 2,
-      "c": "#e26757"
+      "x": 2
     },
     "ESC"
   ],
       "rx": 13,
       "y": -1,
       "x": -3,
-      "c": "#f9cd31",
       "f": 2
     },
     "MEDIA",
     },
     "HUN",
     {
-      "c": "#d4872a",
       "f": 9,
       "h": 2
     },
   [
     {
       "x": -3,
-      "c": "#f9cd31",
       "f": 2
     },
     "LEAD"
index 1248d36af72b4ab1c1f5bb9eeb5546435993b711..5b4ca06c308c622d2ac635b83b67a58021461076 100644 (file)
   [
     {
       "x": 3.5,
-      "c": "#a7d0db",
       "fa": [
         0,
         0,
         2
       ]
     },
-    "#\n3\nF3",
+    "*\n5\nF5",
     {
       "x": 10.5,
-      "c": "#a7d0db",
-      "t": "#000000",
       "a": 4,
       "fa": [
         0,
         2
       ]
     },
-    "*\n8\nF8"
+    "#\n4\nF4"
   ],
   [
     {
       "y": -0.875,
-      "x": 2.5,
-      "c": "#bfbad1",
-      "t": "#0d0d0b"
+      "x": 2.5
     },
-    "@\n2\nF2",
+    "@\n7\nF7",
     {
-      "x": 1,
-      "c": "#7adabd",
-      "t": "#000000"
+      "x": 1
     },
-    "$\n4\nF4",
+    "^\n3\nF3",
     {
       "x": 8.5
     },
-    "&\n7\nF7",
+    "!\n2\nF2",
     {
-      "x": 1,
-      "c": "#bfbad1",
-      "t": "#0d0d0b"
+      "x": 1
     },
-    "(\n9\nF9"
+    "&\n6\nF6"
   ],
   [
     {
       "y": -0.875,
-      "x": 5.5,
-      "c": "#7adabd",
-      "t": "#000000"
+      "x": 5.5
     },
-    "%\n5\nF5",
+    "$\n1\nF1",
     {
-      "c": "#f9cd31",
       "a": 7,
-      "f": 2
+      "f": 3
     },
-    "STENO",
+    "F11",
     {
       "x": 4.5,
       "f": 3
     },
     "F12",
     {
-      "c": "#7adabd",
       "a": 4,
       "f": 3,
       "fa": [
         2
       ]
     },
-    "^\n6\nF6"
+    "%\n0\nF10"
   ],
   [
     {
       "y": -0.875,
-      "c": "#ffb2d2",
       "f": 6,
       "a": 6,
       "w": 1.5
     "<i class='fa fa-fast-backward'></i>\n\n<i class='fa fa-fast-forward'></i>",
     {
       "f": 3,
-      "t": "#0d0d0b",
       "a": 4,
       "fa": [
           0,
       ]
 
     },
-    "!\n1\nF1",
+    " \n9\nF9",
     {
       "x": 14.5
     },
-    ")\n0\nF10",
+    " \n8\nF8",
     {
       "a": 7,
       "w": 1.5
     },
-    "F11"
+    "STENO"
   ],
   [
     {
       "y": -0.375,
       "x": 3.5,
-      "c": "#a7d0db",
-      "t": "#000000",
       "a": 4
     },
     ">\n.",
     {
       "y": -0.875,
       "x": 2.5,
-      "c": "#bfbad1",
-      "t": "#0d0d0b",
       "a": 4
     },
     "<\n,",
     {
       "x": 1,
-      "c": "#7adabd",
-      "t": "#000000",
       "a": 6
     },
     "P",
     },
     "G",
     {
-      "x": 1,
-      "c": "#bfbad1",
-      "t": "#0d0d0b"
+      "x": 1
     },
     "R"
   ],
   [
     {
       "y": -0.875,
-      "x": 5.5,
-      "c": "#7adabd",
-      "t": "#000000"
+      "x": 5.5
     },
     "Y",
     {
-      "c": "#93c9b7",
       "a": 4,
       "h": 1.5
     },
     },
     "}\n)\n]",
     {
-      "c": "#7adabd",
       "a": 6
     },
     "F"
   [
     {
       "y": -0.875,
-      "c": "#ffb07b",
-      "t": "#0d0d0b",
       "f": 3,
+      "a": 4,
       "w": 1.5
     },
     "\n\n~\n`",
     {
-      "c": "#ffb2d2",
       "a": 4,
       "f": 3
     },
     {
       "y": -0.375,
       "x": 3.5,
-      "c": "#a7d0db",
-      "t": "#000000",
       "a": 6
     },
     "E",
   [
     {
       "y": -0.875,
-      "x": 2.5,
-      "c": "#bfbad1",
-      "t": "#0d0d0b"
+      "x": 2.5
     },
     "O",
     {
       "x": 1,
-      "c": "#7adabd",
-      "t": "#000000",
       "n": true
     },
     "U",
     },
     "H",
     {
-      "x": 1,
-      "c": "#bfbad1",
-      "t": "#0d0d0b"
+      "x": 1
     },
     "N"
   ],
   [
     {
       "y": -0.875,
-      "x": 5.5,
-      "c": "#7adabd",
-      "t": "#000000"
+      "x": 5.5
     },
     "I",
     {
   [
     {
       "y": -0.875,
-      "c": "#ffb2d2",
-      "t": "#0d0d0b",
       "fa": [
         6
       ],
     {
       "y": -0.625,
       "x": 6.5,
-      "c": "#93c9b7",
-      "t": "#000000",
       "a": 7,
+      "f": 9,
       "h": 1.5
     },
-    "(",
+    "<i class='fa fa-columns'></i>",
     {
       "x": 4.5,
       "h": 1.5
     },
-    ")"
+    "<i class='fa fa-table'></i>"
   ],
   [
     {
       "y": -0.75,
       "x": 3.5,
-      "c": "#a7d0db",
+      "f": 3,
       "a": 6
     },
     "J",
   [
     {
       "y": -0.875,
-      "x": 2.5,
-      "c": "#bfbad1",
-      "t": "#0d0d0b"
+      "x": 2.5
     },
     "Q",
     {
-      "x": 1,
-      "c": "#7adabd",
-      "t": "#000000"
+      "x": 1
     },
     "K",
     {
     },
     "M",
     {
-      "x": 1,
-      "c": "#bfbad1",
-      "t": "#0d0d0b"
+      "x": 1
     },
     "V"
   ],
   [
     {
       "y": -0.875,
-      "x": 5.5,
-      "c": "#7adabd",
-      "t": "#000000"
+      "x": 5.5
     },
     "X",
     {
   [
     {
       "y": -0.875,
-      "c": "#ffb07b",
       "f": 9,
       "w": 1.5
     },
     "\n\n<i class='kb kb-Multimedia-Play-Pause'></i>",
     {
-      "c": "#ffb2d2",
-      "t": "#0d0d0b",
       "a": 4,
       "f": 3
     },
     },
     "Z",
     {
-      "c": "#ffb07b",
-      "t": "#000000",
       "f": 9,
       "w": 1.5
     },
     {
       "y": -0.375,
       "x": 3.5,
-      "c": "#d9dae0",
       "g": true,
       "a": 7,
       "f": 3
     "",
     {
       "x": 1,
-      "c": "#d4872a",
       "g": false,
       "a": 5
     },
     "_\n-",
     {
       "x": 1,
-      "c": "#d9dae0",
       "g": true,
       "a": 7
     },
       "ry": 4.25,
       "y": -1,
       "x": 1,
-      "c": "#f9cd31",
       "g": false
     },
     "Alt",
   ],
   [
     {
-      "c": "#d4872a",
       "a": 7,
       "f": 9,
       "h": 2
     },
     "<i class='fa fa-angle-double-up'></i>",
     {
-      "c": "#f9cd31",
       "f": 3
     },
     "Ctrl"
   ],
   [
     {
-      "x": 2,
-      "c": "#e26757"
+      "x": 2
     },
     "ESC"
   ],
       "rx": 13,
       "y": -1,
       "x": -3,
-      "c": "#f9cd31",
       "f": 2
     },
     "MEDIA",
     },
     "LEAD",
     {
-      "c": "#d4872a",
       "f": 9,
       "h": 2
     },
   [
     {
       "x": -3,
-      "c": "#f9cd31",
       "f": 2
     },
     "HUN"
diff --git a/keyboards/ergodox/keymaps/algernon/tools/hid-commands b/keyboards/ergodox/keymaps/algernon/tools/hid-commands
new file mode 100755 (executable)
index 0000000..f3b83cf
--- /dev/null
@@ -0,0 +1,61 @@
+#!/bin/bash
+set -e
+
+cmd_wm () {
+    WIN="$(xdotool getactivewindow)"
+    wmctrl -i -r ${WIN} -b remove,maximized_vert,maximized_horz
+    xdotool windowsize ${WIN} 100% 100%
+    wmctrl -i -r ${WIN} -b add,maximized_vert,maximized_horz
+}
+
+_cmd_appsel () {
+    wmctrl -x -a $1 || true
+    xdotool key Escape
+}
+
+cmd_appsel_music () {
+    wmctrl -x -a rhythmbox || wmctrl -x -a spotify || true
+    xdotool key Escape
+}
+
+cmd_appsel_slack () {
+    _cmd_appsel slack
+}
+
+cmd_appsel_emacs () {
+    _cmd_appsel emacs24
+}
+
+cmd_appsel_term () {
+    _cmd_appsel gnome-terminal
+}
+
+cmd_appsel_chrome () {
+    _cmd_appsel chromium
+}
+
+cmd_help () {
+    cat <<EOF
+Use the source, Luke!
+EOF
+}
+
+while read l; do
+    case "$l" in
+        "CMD:"*)
+            ;;
+        *)
+            continue
+            ;;
+    esac
+
+    cmd="$(echo $l | cut -d: -f2-)"
+
+    echo "Got command: ${cmd}"
+
+    if type cmd_${cmd} >/dev/null 2>&1; then
+        cmd_${cmd}
+    fi
+done
+
+
diff --git a/keyboards/ergodox/keymaps/algernon/tools/layer-notify b/keyboards/ergodox/keymaps/algernon/tools/layer-notify
new file mode 100755 (executable)
index 0000000..627c286
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+HL="${HID_LISTEN:-$HOME/src/ext/hid_listen/hid_listen}"
+
+sudo "${HL}" | grep --line-buffered LAYER: | \
+(while read line; do
+     case $line in
+         LAYER:*)
+             layer="$(echo $(echo $line | cut -d: -f2-))"
+             notify-send -i mark-location-symbolic "Switched to layer: $layer"
+             ;;
+     esac
+ done)
index 68585843bed0eeb9b9092fcc8a40b658d44619de..09c737646ceb335de0cba1878241601ba3feea8b 100755 (executable)
@@ -1,12 +1,15 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
 import json
 import os
 import sys
 import re
 import argparse
+import time
 
 from math import floor
 from os.path import dirname
+from subprocess import Popen, PIPE, STDOUT
+from blessings import Terminal
 
 class Heatmap(object):
     coords = [
@@ -33,7 +36,7 @@ class Heatmap(object):
         [
             # Row 4
             [20,  0], [20,  2], [19,  0], [18,  0], [19,  2], [], [], [], [],
-            [19,  4], [18,  2], [19,  6], [20,  4], [20,  6],
+            [19,  4], [18,  2], [19,  6], [20,  4], [20,  6], [], [], [], []
         ],
         [
             # Row 5
@@ -56,11 +59,13 @@ class Heatmap(object):
     def set_attr(orig, new):
         return new
 
-    def set_bg(self, (block, n), color):
+    def set_bg(self, coords, color):
+        (block, n) = coords
         self.set_attr_at(block, n, "c", self.set_attr, color)
         #self.set_attr_at(block, n, "g", self.set_attr, False)
 
-    def set_tap_info(self, (block, n), count, cap):
+    def set_tap_info(self, coords, count, cap):
+        (block, n) = coords
         def _set_tap_info(o, _count, _cap):
             ns = 4 - o.count ("\n")
             return o + "\n" * ns + "%.02f%%" % (float(_count) / float(_cap) * 100)
@@ -87,8 +92,8 @@ class Heatmap(object):
         g = (colors[idx2][1] - colors[idx1][1]) * fb + colors[idx1][1]
         b = (colors[idx2][2] - colors[idx1][2]) * fb + colors[idx1][2]
 
-        r, g, b = [x * 255 for x in r, g, b]
-        return "#%02x%02x%02x" % (r, g, b)
+        r, g, b = [x * 255 for x in (r, g, b)]
+        return "#%02x%02x%02x" % (int(r), int(g), int(b))
 
     def __init__(self, layout):
         self.log = {}
@@ -96,7 +101,8 @@ class Heatmap(object):
         self.max_cnt = 0
         self.layout = layout
 
-    def update_log(self, (c, r)):
+    def update_log(self, coords):
+        (c, r) = coords
         if not (c, r) in self.log:
             self.log[(c, r)] = 0
         self.log[(c, r)] = self.log[(c, r)] + 1
@@ -132,18 +138,17 @@ class Heatmap(object):
             # right hand
             [0, 0, 0, 0, 0]
         ]
-        finger_map = [0, 0, 1, 2, 3, 4, 4]
+        finger_map = [0, 0, 1, 2, 3, 3, 3, 1, 1, 1, 2, 3, 4, 4]
         for (c, r) in self.log:
             if r == 5: # thumb cluster
                 if c <= 6: # left side
                     usage[0][4] = usage[0][4] + self.log[(c, r)]
                 else:
-                    usage[1][4] = usage[1][4] + self.log[(c, r)]
+                    usage[1][0] = usage[1][0] + self.log[(c, r)]
             else:
                 fc = c
                 hand = 0
                 if fc >= 7:
-                    fc = fc - 7
                     hand = 1
                 fm = finger_map[fc]
                 usage[hand][fm] = usage[hand][fm] + self.log[(c, r)]
@@ -157,79 +162,158 @@ class Heatmap(object):
         if total == 0:
             total = 1
         stats = {
+            "total-keys": total,
             "hands": {
                 "left": {
-                    "usage": float(hand_usage[0]) / total * 100,
+                    "usage": round(float(hand_usage[0]) / total * 100, 2),
                     "fingers": {
-                        "0 - pinky": 0,
-                        "1 - ring": 0,
-                        "2 - middle": 0,
-                        "3 - index": 0,
-                        "4 - thumb": 0,
+                        "pinky": 0,
+                        "ring": 0,
+                        "middle": 0,
+                        "index": 0,
+                        "thumb": 0,
                     }
                 },
                 "right": {
-                    "usage": float(hand_usage[1]) / total * 100,
+                    "usage": round(float(hand_usage[1]) / total * 100, 2),
                     "fingers": {
-                        "0 - thumb": 0,
-                        "1 - index": 0,
-                        "2 - middle": 0,
-                        "3 - ring": 0,
-                        "4 - pinky": 0,
+                        "thumb": 0,
+                        "index": 0,
+                        "middle": 0,
+                        "ring": 0,
+                        "pinky": 0,
                     }
                 },
             }
         }
 
         hmap = ['left', 'right']
-        fmap = ['0 - pinky', '1 - ring', '2 - middle', '3 - index', '4 - thumb',
-                '0 - thumb', '1 - index', '2 - middle', '3 - ring', '4 - pinky']
+        fmap = ['pinky', 'ring', 'middle', 'index', 'thumb',
+                'thumb', 'index', 'middle', 'ring', 'pinky']
         for hand_idx in range(len(usage)):
             hand = usage[hand_idx]
             for finger_idx in range(len(hand)):
-                stats['hands'][hmap[hand_idx]]['fingers'][fmap[finger_idx + hand_idx * 5]] = float(hand[finger_idx]) / total * 100
+                stats['hands'][hmap[hand_idx]]['fingers'][fmap[finger_idx + hand_idx * 5]] = round(float(hand[finger_idx]) / total * 100, 2)
         return stats
 
 def dump_all(out_dir, heatmaps):
-    for layer in heatmaps.keys():
+    stats = {}
+    t = Terminal()
+    t.clear()
+    sys.stdout.write("\x1b[2J\x1b[H")
+
+    print ('{t.underline}{outdir}{t.normal}\n'.format(t=t, outdir=out_dir))
+
+    keys = list(heatmaps.keys())
+    keys.sort()
+
+    for layer in keys:
         if len(heatmaps[layer].log) == 0:
             continue
 
         with open ("%s/%s.json" % (out_dir, layer), "w") as f:
             json.dump(heatmaps[layer].get_heatmap(), f)
-        print >>sys.stderr, "%s stats:" % (layer)
-        json.dump (heatmaps[layer].get_stats(), sys.stderr,
-                   indent = 4, sort_keys = True)
-        print >>sys.stderr, ""
-        print >>sys.stderr, ""
+        stats[layer] = heatmaps[layer].get_stats()
 
-def main(opts):
+        left = stats[layer]['hands']['left']
+        right = stats[layer]['hands']['right']
+
+        print ('{t.bold}{layer}{t.normal} ({total:,} taps):'.format(t=t, layer=layer,
+                                                                    total=int(stats[layer]['total-keys'] / 2)))
+        print (('{t.underline}        | ' + \
+                'left ({l[usage]:6.2f}%)  | ' + \
+                'right ({r[usage]:6.2f}%) |{t.normal}').format(t=t, l=left, r=right))
+        print ((' {t.bright_magenta}pinky{t.white}  |     {left[pinky]:6.2f}%     |     {right[pinky]:6.2f}%     |\n' + \
+                ' {t.bright_cyan}ring{t.white}   |     {left[ring]:6.2f}%     |     {right[ring]:6.2f}%     |\n' + \
+                ' {t.bright_blue}middle{t.white} |     {left[middle]:6.2f}%     |     {right[middle]:6.2f}%     |\n' + \
+                ' {t.bright_green}index{t.white}  |     {left[index]:6.2f}%     |     {right[index]:6.2f}%     |\n' + \
+                ' {t.bright_red}thumb{t.white}  |     {left[thumb]:6.2f}%     |     {right[thumb]:6.2f}%     |\n' + \
+                '').format(left=left['fingers'], right=right['fingers'], t=t))
+
+def process_line(line, heatmaps, opts, stamped_log = None):
+    m = re.search ('KL: col=(\d+), row=(\d+), pressed=(\d+), layer=(.*)', line)
+    if not m:
+        return False
+    if stamped_log is not None:
+        if line.startswith("KL:"):
+            print ("%10.10f %s" % (time.time(), line),
+                   file = stamped_log, end = '')
+        else:
+            print (line,
+                   file = stamped_log, end = '')
+        stamped_log.flush()
+
+    (c, r, l) = (int(m.group (2)), int(m.group (1)), m.group (4))
+    if (c, r) not in opts.allowed_keys:
+        return False
+
+    heatmaps[l].update_log ((c, r))
+
+    return True
+
+def setup_allowed_keys(opts):
+    if len(opts.only_key):
+        incmap={}
+        for v in opts.only_key:
+            m = re.search ('(\d+),(\d+)', v)
+            if not m:
+                continue
+            (c, r) = (int(m.group(1)), int(m.group(2)))
+            incmap[(c, r)] = True
+    else:
+        incmap={}
+        for r in range(0, 6):
+            for c in range(0, 14):
+                incmap[(c, r)] = True
 
+        for v in opts.ignore_key:
+            m = re.search ('(\d+),(\d+)', v)
+            if not m:
+                continue
+            (c, r) = (int(m.group(1)), int(m.group(2)))
+            del(incmap[(c, r)])
+
+    return incmap
+
+def main(opts):
     heatmaps = {"Dvorak": Heatmap("Dvorak"),
                 "ADORE": Heatmap("ADORE")
     }
     cnt = 0
-    restrict_row = opts.restrict_row
     out_dir = opts.outdir
 
+    if not os.path.exists(out_dir):
+        os.makedirs(out_dir)
+
+    opts.allowed_keys = setup_allowed_keys(opts)
+
+    if not opts.one_shot:
+
+        try:
+            with open("%s/stamped-log" % out_dir, "r") as f:
+                while True:
+                    line = f.readline()
+                    if not line:
+                        break
+                    if not process_line(line, heatmaps, opts):
+                        continue
+        except:
+            pass
+
+        stamped_log = open ("%s/stamped-log" % (out_dir), "a+")
+    else:
+        stamped_log = None
+
     while True:
         line = sys.stdin.readline()
         if not line:
             break
-        m = re.search ('KL: col=(\d+), row=(\d+), pressed=(\d+), layer=(.*)', line)
-        if not m:
+        if not process_line(line, heatmaps, opts, stamped_log):
             continue
 
         cnt = cnt + 1
-        (c, r, l) = (int(m.group (2)), int(m.group (1)), m.group (4))
-        if restrict_row != -1 and r != restrict_row:
-            continue
-        if c in opts.ignore_columns:
-            continue
-
-        heatmaps[l].update_log ((c, r))
 
-        if opts.dump_interval != -1 and cnt >= opts.dump_interval:
+        if opts.dump_interval != -1 and cnt >= opts.dump_interval and not opts.one_shot:
             cnt = 0
             dump_all(out_dir, heatmaps)
 
@@ -239,11 +323,17 @@ if __name__ == "__main__":
     parser = argparse.ArgumentParser (description = "keylog to heatmap processor")
     parser.add_argument ('outdir', action = 'store',
                          help = 'Output directory')
-    parser.add_argument ('--row', dest = 'restrict_row', action = 'store', type = int,
-                         default = -1, help = 'Restrict processing to this row only')
     parser.add_argument ('--dump-interval', dest = 'dump_interval', action = 'store', type = int,
                          default = 100, help = 'Dump stats and heatmap at every Nth event, -1 for dumping at EOF only')
-    parser.add_argument ('--ignore-column', dest = 'ignore_columns', action = 'append', type = int,
-                         default = [], help = 'Ignore the specified columns')
+    parser.add_argument ('--ignore-key', dest = 'ignore_key', action = 'append', type = str,
+                         default = [], help = 'Ignore the key at position (x, y)')
+    parser.add_argument ('--only-key', dest = 'only_key', action = 'append', type = str,
+                         default = [], help = 'Only include key at position (x, y)')
+    parser.add_argument ('--one-shot', dest = 'one_shot', action = 'store_true',
+                         help = 'Do not load previous data, and do not update it, either.')
     args = parser.parse_args()
+    if len(args.ignore_key) and len(args.only_key):
+        print ("--ignore-key and --only-key are mutually exclusive, please only use one of them!",
+               file = sys.stderr)
+        sys.exit(1)
     main(args)
diff --git a/keyboards/ergodox/keymaps/algernon/tools/max-focused b/keyboards/ergodox/keymaps/algernon/tools/max-focused
deleted file mode 100755 (executable)
index 4d5220a..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#! /bin/sh
-WIN="$(xdotool getactivewindow)"
-wmctrl -i -r ${WIN} -b remove,maximized_vert,maximized_horz
-xdotool windowsize ${WIN} 100% 100%
-wmctrl -i -r ${WIN} -b add,maximized_vert,maximized_horz
diff --git a/keyboards/ergodox/keymaps/algernon/tools/text-to-log.py b/keyboards/ergodox/keymaps/algernon/tools/text-to-log.py
new file mode 100755 (executable)
index 0000000..e068c3c
--- /dev/null
@@ -0,0 +1,107 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+
+charmap = {
+    '9': [[1, 0]],
+    '7': [[2, 0]], '@': [[2, 5], [2, 0]],
+    '5': [[3, 0]], '*': [[2, 5], [3, 0]],
+    '3': [[4, 0]], '^': [[2, 5], [4, 0]],
+    '1': [[5, 0]], '$': [[2, 5], [5, 0]],
+    '0': [[8, 0]], '%': [[2, 5], [8, 0]],
+    '2': [[9, 0]], '!': [[2, 5], [9, 0]],
+    '4': [[10, 0]], '#': [[2, 5], [10, 0]],
+    '6': [[11, 0]], '&': [[2, 5], [11, 0]],
+    '8': [[12, 0]],
+
+    '`': [[0, 1]], '~': [[2, 5], [0, 1]],
+    'y': [[1, 1]], 'Y': [[2, 5], [1, 1]],
+    'w': [[2, 1]], 'W': [[2, 5], [2, 1]],
+    'g': [[3, 1]], 'G': [[2, 5], [3, 1]],
+    'l': [[4, 1]], 'L': [[2, 5], [4, 1]],
+    'm': [[5, 1]], 'M': [[2, 5], [5, 1]],
+    '[': [[6, 1]], '{': [[2, 5], [6, 1]], '(': [[6, 1], [6, 1]],
+    ']': [[7, 1]], '}': [[2, 5], [7, 1]], ')': [[7, 1], [7, 1]],
+    'f': [[8, 1]], 'F': [[2, 5], [8, 1]],
+    'h': [[9, 1]], 'H': [[2, 5], [9, 1]],
+    'c': [[10, 1]], 'C': [[2, 5], [10, 1]],
+    'p': [[11, 1]], 'P': [[2, 5], [11, 1]],
+    'x': [[12, 1]], 'X': [[2, 5], [12, 1]],
+    '\\': [[13, 1]], '|': [[2, 5], [13, 1]],
+
+    '\t': [[0, 2]],
+    'a': [[1, 2]], 'A': [[2, 5], [1, 2]],
+    'o': [[2, 2]], 'O': [[2, 5], [2, 2]],
+    'e': [[3, 2]], 'E': [[2, 5], [3, 2]],
+    'i': [[4, 2]], 'I': [[2, 5], [4, 2]],
+    'u': [[5, 2]], 'U': [[2, 5], [5, 2]],
+    'd': [[8, 2]], 'D': [[2, 5], [8, 2]],
+    'r': [[9, 2]], 'R': [[2, 5], [9, 2]],
+    't': [[10, 2]], 'T': [[2, 5], [10, 2]],
+    'n': [[11, 2]], 'N': [[2, 5], [11, 2]],
+    's': [[12, 2]], 'S': [[2, 5], [12, 2]],
+    '=': [[13, 2]], '+': [[2, 5], [13, 2]],
+
+    'z': [[1, 3]], 'Z': [[2, 5], [1, 3]],
+    'q': [[2, 3]], 'Q': [[2, 5], [2, 3]],
+    '\'': [[3, 3]], '"': [[2, 5], [3, 3]],
+    ',': [[4, 3]], '<': [[2, 5], [4, 3]],
+    '.': [[5, 3]], '>': [[2, 5], [5, 3]],
+    'b': [[8, 3]], 'B': [[2, 5], [8, 3]],
+    'k': [[9, 3]], 'K': [[2, 5], [9, 3]],
+    'v': [[10, 3]], 'V': [[2, 5], [10, 3]],
+    'j': [[11, 3]], 'J': [[2, 5], [11, 3]],
+    '/': [[12, 3]], '?': [[2, 5], [12, 3]],
+
+    ':': [[4, 4]], ';': [[4, 4], [4, 4]],
+    '-': [[9, 4]], '_': [[2, 5], [9, 4]],
+
+    ' ': [[10, 5]],
+    '\n': [[11, 5]],
+
+    ## Layered things
+    # Hungarian
+    'á': [[9, 5], [1, 2]],  'Á': [[2, 5], [9, 5], [1, 2]],
+    'ó': [[9, 5], [2, 2]],  'Ó': [[2, 5], [9, 5], [2, 2]],
+    'ő': [[9, 5], [2, 1]],  'Ő': [[2, 5], [9, 5], [2, 1]],
+    'ö': [[9, 5], [2, 3]],  'Ö': [[2, 5], [9, 5], [2, 3]],
+    'é': [[9, 5], [3, 2]],  'É': [[2, 5], [9, 5], [3, 2]],
+    'ú': [[9, 5], [4, 2]],  'Ú': [[2, 5], [9, 5], [4, 2]],
+    'ű': [[9, 5], [4, 1]],  'Ű': [[2, 5], [9, 5], [4, 1]],
+    'ü': [[9, 5], [4, 3]],  'Ü': [[2, 5], [9, 5], [4, 3]],
+    'í': [[9, 5], [5, 2]],  'Í': [[2, 5], [9, 5], [5, 2]],
+}
+
+def lookup_char(layer, ch):
+    if ch in charmap:
+        return charmap[ch]
+    return None
+
+def process_char(layer, ch, out=sys.stdout):
+    keys = lookup_char(layer, ch)
+    if not keys:
+        print ("Unknown char: %s" % ch, file=sys.stderr)
+    else:
+        for (c, r) in keys:
+            print ("KL: col=%d, row=%d, pressed=1, layer=%s" % (r, c, layer), file=out)
+            print ("KL: col=%d, row=%d, pressed=0, layer=%s" % (r, c, layer), file=out)
+
+def process_file(fn, layer, out=sys.stdout):
+    with open(fn, "r") as f:
+        ch = f.read(1)
+        while ch:
+            process_char(layer, ch, out)
+            ch = f.read(1)
+
+if sys.argv[1] == '-':
+    out='/dev/stdin'
+else:
+    out=sys.argv[1]
+
+if len(sys.argv) >= 2:
+    layer = 'ADORE'
+else:
+    layer = sys.argv[2]
+
+process_file(out, layer = layer)
index 1b80cb3a236f628f99ef05a2ae4f7ad5066d9aeb..2f399bd18150959813c30746124b80570bebec56 100644 (file)
@@ -7,6 +7,8 @@
 #define SYMB 1 // symbols
 #define MDIA 2 // media keys
 
+#define EPRM M(1) // Macro 1: Reset EEPROM
+
 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
 /* Keymap 0: Basic layer
  *
@@ -62,7 +64,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
  * |        |   %  |   ^  |   [  |   ]  |   ~  |      |           |      |   &  |   1  |   2  |   3  |   \  |        |
  * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
- *   |      |      |      |      |      |                                       |      |    . |   0  |   =  |      |
+ *   | EPRM |      |      |      |      |                                       |      |    . |   0  |   =  |      |
  *   `----------------------------------'                                       `----------------------------------'
  *                                        ,-------------.       ,-------------.
  *                                        |      |      |       |      |      |
@@ -79,7 +81,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        KC_TRNS,KC_EXLM,KC_AT,  KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS,
        KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV,
        KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS,
-       KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
+          EPRM,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
                                        KC_TRNS,KC_TRNS,
                                                KC_TRNS,
                                KC_TRNS,KC_TRNS,KC_TRNS,
@@ -149,6 +151,11 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
           SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
         }
         break;
+        case 1:
+        if (record->event.pressed) { // For resetting EEPROM
+          eeconfig_init();
+        }
+        break;
       }
     return MACRO_NONE;
 };
@@ -158,6 +165,7 @@ void matrix_init_user(void) {
 
 };
 
+
 // Runs constantly in the background, in a loop.
 void matrix_scan_user(void) {
 
index 8f6dba45e9a67d28de86d871996b180384b66f2e..f68138ed628f3e4281590fa922247292b11342d8 100644 (file)
@@ -2,6 +2,8 @@
 
 ## Changelog
 
+* Sep 22, 2016:
+  * Created a new key in layer 1 (bottom-corner key) that resets the EEPROM.
 * Feb 2, 2016 (V1.1): 
   * Made the right-hand quote key double as Cmd/Win on hold. So you get ' when you tap it, " when you tap it with Shift, and Cmd or Win when you hold it. You can then use it as a modifier, or just press and hold it for a moment (and then let go) to send a single Cmd or Win keystroke (handy for opening the Start menu on Windows).
 
index c4a9b9ff82de09de25d5d22051c0f82a5c5de303..29695d0b9d74a93eecca350d12e12cd3db5ad2a0 100644 (file)
@@ -62,7 +62,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //#define MATRIX_HAS_GHOST
 
 /* number of backlight levels */
-#define BACKLIGHT_LEVELS 3
+#define BACKLIGHT_LEVELS 5
 
 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
 #define LOCKING_SUPPORT_ENABLE
index ec99514aa37ba08ace4eab83a38ba93c9650d15e..f4d900accbe410f98c13b00bba935d4577344bcc 100644 (file)
@@ -41,6 +41,11 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 // #define USE_I2C
 
+// Use serial if not using I2C
+#ifndef USE_I2C
+#  define USE_SERIAL
+#endif
+
 // #define EE_HANDS
 
 #define I2C_MASTER_LEFT
@@ -94,4 +99,4 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //#define NO_ACTION_MACRO
 //#define NO_ACTION_FUNCTION
 
-#endif
\ No newline at end of file
+#endif
index c72789403e558eb7288b1852d6a96ff47842910f..084c890c405fa6f7ebfc1be7a699e3d120e5c482 100644 (file)
@@ -6,6 +6,8 @@
 #include <stdbool.h>
 #include "i2c.h"
 
+#ifdef USE_I2C
+
 // Limits the amount of we wait for any one i2c transaction.
 // Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is
 // 9 bits, a single transaction will take around 90μs to complete.
@@ -157,3 +159,4 @@ ISR(TWI_vect) {
   // Reset everything, so we are ready for the next TWI interrupt
   TWCR |= (1<<TWIE) | (1<<TWINT) | (ack<<TWEA) | (1<<TWEN);
 }
+#endif
diff --git a/keyboards/lets_split/keymaps/i2c/config.h b/keyboards/lets_split/keymaps/i2c/config.h
new file mode 100644 (file)
index 0000000..2671fab
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+Copyright 2012 Jun Wako <wakojun@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+#include "config_common.h"
+
+/* USB Device descriptor parameter */
+#define VENDOR_ID       0xFEED
+#define PRODUCT_ID      0x3060
+#define DEVICE_VER      0x0001
+#define MANUFACTURER    Wootpatoot
+#define PRODUCT         Lets Split
+#define DESCRIPTION     A split keyboard for the cheap makers
+
+/* key matrix size */
+// Rows are doubled-up
+#define MATRIX_ROWS 8
+#define MATRIX_COLS 6
+
+// wiring of each half
+#define MATRIX_ROW_PINS { B5, B4, E6, D7 }
+#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3 }
+
+#define CATERINA_BOOTLOADER
+
+#define USE_I2C
+
+// Use serial if not using I2C
+#ifndef USE_I2C
+#  define USE_SERIAL
+#endif
+
+// #define EE_HANDS
+
+#define I2C_MASTER_LEFT
+// #define I2C_MASTER_RIGHT
+
+/* COL2ROW or ROW2COL */
+#define DIODE_DIRECTION COL2ROW
+
+/* define if matrix has ghost */
+//#define MATRIX_HAS_GHOST
+
+/* number of backlight levels */
+// #define BACKLIGHT_LEVELS 3
+
+/* Set 0 if debouncing isn't needed */
+#define DEBOUNCING_DELAY 5
+
+/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
+#define LOCKING_SUPPORT_ENABLE
+/* Locking resynchronize hack */
+#define LOCKING_RESYNC_ENABLE
+
+/* key combination for command */
+#define IS_COMMAND() ( \
+    keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
+)
+
+/* ws2812 RGB LED */
+#define RGB_DI_PIN D4
+#define RGBLIGHT_TIMER
+#define RGBLED_NUM 8     // Number of LEDs
+#define RGBLIGHT_HUE_STEP 10
+#define RGBLIGHT_SAT_STEP 17
+#define RGBLIGHT_VAL_STEP 17
+
+/*
+ * Feature disable options
+ *  These options are also useful to firmware size reduction.
+ */
+
+/* disable debug print */
+// #define NO_DEBUG
+
+/* disable print */
+// #define NO_PRINT
+
+/* disable action features */
+//#define NO_ACTION_LAYER
+//#define NO_ACTION_TAPPING
+//#define NO_ACTION_ONESHOT
+//#define NO_ACTION_MACRO
+//#define NO_ACTION_FUNCTION
+
+#endif
diff --git a/keyboards/lets_split/keymaps/i2c/keymap.c b/keyboards/lets_split/keymaps/i2c/keymap.c
new file mode 100644 (file)
index 0000000..0d2d94b
--- /dev/null
@@ -0,0 +1,214 @@
+#include "lets_split.h"
+#include "action_layer.h"
+#include "eeconfig.h"
+
+extern keymap_config_t keymap_config;
+
+// Each layer gets a name for readability, which is then used in the keymap matrix below.
+// The underscores don't mean anything - you can have a layer called STUFF or any other name.
+// Layer names don't all need to be of the same length, obviously, and you can also skip them
+// entirely and just use numbers.
+#define _QWERTY 0
+#define _COLEMAK 1
+#define _DVORAK 2
+#define _LOWER 3
+#define _RAISE 4
+#define _ADJUST 16
+
+enum custom_keycodes {
+  QWERTY = SAFE_RANGE,
+  COLEMAK,
+  DVORAK,
+  LOWER,
+  RAISE,
+  ADJUST,
+};
+
+// Fillers to make layering more clear
+#define _______ KC_TRNS
+#define XXXXXXX KC_NO
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+/* Qwerty
+ * ,-----------------------------------------------------------------------------------.
+ * | Tab  |   Q  |   W  |   E  |   R  |   T  |   Y  |   U  |   I  |   O  |   P  | Bksp |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Esc  |   A  |   S  |   D  |   F  |   G  |   H  |   J  |   K  |   L  |   ;  |  "   |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift|   Z  |   X  |   C  |   V  |   B  |   N  |   M  |   ,  |   .  |   /  |Enter |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |Adjust| Ctrl | Alt  | GUI  |Lower |Space |Space |Raise | Left | Down |  Up  |Right |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_QWERTY] = KEYMAP( \
+  KC_TAB,  KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,    KC_Y,    KC_U,    KC_I,    KC_O,    KC_P,    KC_BSPC, \
+  KC_ESC,  KC_A,    KC_S,    KC_D,    KC_F,    KC_G,    KC_H,    KC_J,    KC_K,    KC_L,    KC_SCLN, KC_QUOT, \
+  KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_ENT , \
+  ADJUST,  KC_LCTL, KC_LALT, KC_LGUI, LOWER,   KC_SPC,  KC_SPC,  RAISE,   KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT \
+),
+
+/* Colemak
+ * ,-----------------------------------------------------------------------------------.
+ * | Tab  |   Q  |   W  |   F  |   P  |   G  |   J  |   L  |   U  |   Y  |   ;  | Bksp |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Esc  |   A  |   R  |   S  |   T  |   D  |   H  |   N  |   E  |   I  |   O  |  "   |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift|   Z  |   X  |   C  |   V  |   B  |   K  |   M  |   ,  |   .  |   /  |Enter |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |Adjust| Ctrl | Alt  | GUI  |Lower |Space |Space |Raise | Left | Down |  Up  |Right |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_COLEMAK] = KEYMAP( \
+  KC_TAB,  KC_Q,    KC_W,    KC_F,    KC_P,    KC_G,    KC_J,    KC_L,    KC_U,    KC_Y,    KC_SCLN, KC_BSPC, \
+  KC_ESC,  KC_A,    KC_R,    KC_S,    KC_T,    KC_D,    KC_H,    KC_N,    KC_E,    KC_I,    KC_O,    KC_QUOT, \
+  KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_K,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_ENT , \
+  ADJUST,  KC_LCTL, KC_LALT, KC_LGUI, LOWER,   KC_SPC,  KC_SPC,  RAISE,   KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT \
+),
+
+/* Dvorak
+ * ,-----------------------------------------------------------------------------------.
+ * | Tab  |   "  |   ,  |   .  |   P  |   Y  |   F  |   G  |   C  |   R  |   L  | Bksp |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Esc  |   A  |   O  |   E  |   U  |   I  |   D  |   H  |   T  |   N  |   S  |  /   |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift|   ;  |   Q  |   J  |   K  |   X  |   B  |   M  |   W  |   V  |   Z  |Enter |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |Adjust| Ctrl | Alt  | GUI  |Lower |Space |Space |Raise | Left | Down |  Up  |Right |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_DVORAK] = KEYMAP( \
+  KC_TAB,  KC_QUOT, KC_COMM, KC_DOT,  KC_P,    KC_Y,    KC_F,    KC_G,    KC_C,    KC_R,    KC_L,    KC_BSPC, \
+  KC_ESC,  KC_A,    KC_O,    KC_E,    KC_U,    KC_I,    KC_D,    KC_H,    KC_T,    KC_N,    KC_S,    KC_SLSH, \
+  KC_LSFT, KC_SCLN, KC_Q,    KC_J,    KC_K,    KC_X,    KC_B,    KC_M,    KC_W,    KC_V,    KC_Z,    KC_ENT , \
+  ADJUST,  KC_LCTL, KC_LALT, KC_LGUI, LOWER,   KC_SPC,  KC_SPC,  RAISE,   KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT \
+),
+
+/* Lower
+ * ,-----------------------------------------------------------------------------------.
+ * |   ~  |   !  |   @  |   #  |   $  |   %  |   ^  |   &  |   *  |   (  |   )  | Bksp |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Del  |  F1  |  F2  |  F3  |  F4  |  F5  |  F6  |   _  |   +  |     |    \  |  |   |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * |      |  F7  |  F8  |  F9  |  F10 |  F11 |  F12 |ISO ~ |ISO | |      |      |Enter |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |      |      |      |      |      |             |      | Next | Vol- | Vol+ | Play |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_LOWER] = KEYMAP( \
+  KC_TILD, KC_EXLM, KC_AT,   KC_HASH, KC_DLR,  KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \
+  KC_DEL,  KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,   KC_F6,   KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
+  _______, KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F11,  KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \
+  _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
+),
+
+/* Raise
+ * ,-----------------------------------------------------------------------------------.
+ * |   `  |   1  |   2  |   3  |   4  |   5  |   6  |   7  |   8  |   9  |   0  | Bksp |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Del  |  F1  |  F2  |  F3  |  F4  |  F5  |  F6  |   -  |   =  |   [  |   ]  |  \   |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * |      |  F7  |  F8  |  F9  |  F10 |  F11 |  F12 |ISO # |ISO / |      |      |Enter |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |      |      |      |      |      |             |      | Next | Vol- | Vol+ | Play |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_RAISE] = KEYMAP( \
+  KC_GRV,  KC_1,    KC_2,    KC_3,    KC_4,    KC_5,    KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_BSPC, \
+  KC_DEL,  KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,   KC_F6,   KC_MINS, KC_EQL,  KC_LBRC, KC_RBRC, KC_BSLS, \
+  _______, KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F11,  KC_F12,  KC_NUHS, KC_NUBS, _______, _______, _______, \
+  _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
+),
+
+/* Adjust (Lower + Raise)
+ * ,-----------------------------------------------------------------------------------.
+ * |      | Reset|      |      |      |      |      |      |      |      |      |  Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * |      |      |      |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|      |      |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * |      |      |      |      |      |      |      |      |      |      |      |      |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |      |      |      |      |      |             |      |      |      |      |      |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_ADJUST] =  KEYMAP( \
+  _______, RESET,   _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
+  _______, _______, _______, AU_ON,   AU_OFF,  AG_NORM, AG_SWAP, QWERTY,  COLEMAK, DVORAK,  _______, _______, \
+  _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+  _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
+)
+
+
+};
+
+#ifdef AUDIO_ENABLE
+float tone_qwerty[][2]     = SONG(QWERTY_SOUND);
+float tone_dvorak[][2]     = SONG(DVORAK_SOUND);
+float tone_colemak[][2]    = SONG(COLEMAK_SOUND);
+#endif
+
+void persistant_default_layer_set(uint16_t default_layer) {
+  eeconfig_update_default_layer(default_layer);
+  default_layer_set(default_layer);
+}
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+  switch (keycode) {
+    case QWERTY:
+      if (record->event.pressed) {
+        #ifdef AUDIO_ENABLE
+          PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
+        #endif
+        persistant_default_layer_set(1UL<<_QWERTY);
+      }
+      return false;
+      break;
+    case COLEMAK:
+      if (record->event.pressed) {
+        #ifdef AUDIO_ENABLE
+          PLAY_NOTE_ARRAY(tone_colemak, false, 0);
+        #endif
+        persistant_default_layer_set(1UL<<_COLEMAK);
+      }
+      return false;
+      break;
+    case DVORAK:
+      if (record->event.pressed) {
+        #ifdef AUDIO_ENABLE
+          PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
+        #endif
+        persistant_default_layer_set(1UL<<_DVORAK);
+      }
+      return false;
+      break;
+    case LOWER:
+      if (record->event.pressed) {
+        layer_on(_LOWER);
+        update_tri_layer(_LOWER, _RAISE, _ADJUST);
+      } else {
+        layer_off(_LOWER);
+        update_tri_layer(_LOWER, _RAISE, _ADJUST);
+      }
+      return false;
+      break;
+    case RAISE:
+      if (record->event.pressed) {
+        layer_on(_RAISE);
+        update_tri_layer(_LOWER, _RAISE, _ADJUST);
+      } else {
+        layer_off(_RAISE);
+        update_tri_layer(_LOWER, _RAISE, _ADJUST);
+      }
+      return false;
+      break;
+    case ADJUST:
+      if (record->event.pressed) {
+        layer_on(_ADJUST);
+      } else {
+        layer_off(_ADJUST);
+      }
+      return false;
+      break;
+  }
+  return true;
+}
\ No newline at end of file
diff --git a/keyboards/lets_split/keymaps/serial/config.h b/keyboards/lets_split/keymaps/serial/config.h
new file mode 100644 (file)
index 0000000..f4d900a
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+Copyright 2012 Jun Wako <wakojun@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+#include "config_common.h"
+
+/* USB Device descriptor parameter */
+#define VENDOR_ID       0xFEED
+#define PRODUCT_ID      0x3060
+#define DEVICE_VER      0x0001
+#define MANUFACTURER    Wootpatoot
+#define PRODUCT         Lets Split
+#define DESCRIPTION     A split keyboard for the cheap makers
+
+/* key matrix size */
+// Rows are doubled-up
+#define MATRIX_ROWS 8
+#define MATRIX_COLS 6
+
+// wiring of each half
+#define MATRIX_ROW_PINS { B5, B4, E6, D7 }
+#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3 }
+
+#define CATERINA_BOOTLOADER
+
+// #define USE_I2C
+
+// Use serial if not using I2C
+#ifndef USE_I2C
+#  define USE_SERIAL
+#endif
+
+// #define EE_HANDS
+
+#define I2C_MASTER_LEFT
+// #define I2C_MASTER_RIGHT
+
+/* COL2ROW or ROW2COL */
+#define DIODE_DIRECTION COL2ROW
+
+/* define if matrix has ghost */
+//#define MATRIX_HAS_GHOST
+
+/* number of backlight levels */
+// #define BACKLIGHT_LEVELS 3
+
+/* Set 0 if debouncing isn't needed */
+#define DEBOUNCING_DELAY 5
+
+/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
+#define LOCKING_SUPPORT_ENABLE
+/* Locking resynchronize hack */
+#define LOCKING_RESYNC_ENABLE
+
+/* key combination for command */
+#define IS_COMMAND() ( \
+    keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
+)
+
+/* ws2812 RGB LED */
+#define RGB_DI_PIN D4
+#define RGBLIGHT_TIMER
+#define RGBLED_NUM 8     // Number of LEDs
+#define RGBLIGHT_HUE_STEP 10
+#define RGBLIGHT_SAT_STEP 17
+#define RGBLIGHT_VAL_STEP 17
+
+/*
+ * Feature disable options
+ *  These options are also useful to firmware size reduction.
+ */
+
+/* disable debug print */
+// #define NO_DEBUG
+
+/* disable print */
+// #define NO_PRINT
+
+/* disable action features */
+//#define NO_ACTION_LAYER
+//#define NO_ACTION_TAPPING
+//#define NO_ACTION_ONESHOT
+//#define NO_ACTION_MACRO
+//#define NO_ACTION_FUNCTION
+
+#endif
diff --git a/keyboards/lets_split/keymaps/serial/keymap.c b/keyboards/lets_split/keymaps/serial/keymap.c
new file mode 100644 (file)
index 0000000..0d2d94b
--- /dev/null
@@ -0,0 +1,214 @@
+#include "lets_split.h"
+#include "action_layer.h"
+#include "eeconfig.h"
+
+extern keymap_config_t keymap_config;
+
+// Each layer gets a name for readability, which is then used in the keymap matrix below.
+// The underscores don't mean anything - you can have a layer called STUFF or any other name.
+// Layer names don't all need to be of the same length, obviously, and you can also skip them
+// entirely and just use numbers.
+#define _QWERTY 0
+#define _COLEMAK 1
+#define _DVORAK 2
+#define _LOWER 3
+#define _RAISE 4
+#define _ADJUST 16
+
+enum custom_keycodes {
+  QWERTY = SAFE_RANGE,
+  COLEMAK,
+  DVORAK,
+  LOWER,
+  RAISE,
+  ADJUST,
+};
+
+// Fillers to make layering more clear
+#define _______ KC_TRNS
+#define XXXXXXX KC_NO
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+/* Qwerty
+ * ,-----------------------------------------------------------------------------------.
+ * | Tab  |   Q  |   W  |   E  |   R  |   T  |   Y  |   U  |   I  |   O  |   P  | Bksp |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Esc  |   A  |   S  |   D  |   F  |   G  |   H  |   J  |   K  |   L  |   ;  |  "   |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift|   Z  |   X  |   C  |   V  |   B  |   N  |   M  |   ,  |   .  |   /  |Enter |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |Adjust| Ctrl | Alt  | GUI  |Lower |Space |Space |Raise | Left | Down |  Up  |Right |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_QWERTY] = KEYMAP( \
+  KC_TAB,  KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,    KC_Y,    KC_U,    KC_I,    KC_O,    KC_P,    KC_BSPC, \
+  KC_ESC,  KC_A,    KC_S,    KC_D,    KC_F,    KC_G,    KC_H,    KC_J,    KC_K,    KC_L,    KC_SCLN, KC_QUOT, \
+  KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_ENT , \
+  ADJUST,  KC_LCTL, KC_LALT, KC_LGUI, LOWER,   KC_SPC,  KC_SPC,  RAISE,   KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT \
+),
+
+/* Colemak
+ * ,-----------------------------------------------------------------------------------.
+ * | Tab  |   Q  |   W  |   F  |   P  |   G  |   J  |   L  |   U  |   Y  |   ;  | Bksp |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Esc  |   A  |   R  |   S  |   T  |   D  |   H  |   N  |   E  |   I  |   O  |  "   |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift|   Z  |   X  |   C  |   V  |   B  |   K  |   M  |   ,  |   .  |   /  |Enter |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |Adjust| Ctrl | Alt  | GUI  |Lower |Space |Space |Raise | Left | Down |  Up  |Right |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_COLEMAK] = KEYMAP( \
+  KC_TAB,  KC_Q,    KC_W,    KC_F,    KC_P,    KC_G,    KC_J,    KC_L,    KC_U,    KC_Y,    KC_SCLN, KC_BSPC, \
+  KC_ESC,  KC_A,    KC_R,    KC_S,    KC_T,    KC_D,    KC_H,    KC_N,    KC_E,    KC_I,    KC_O,    KC_QUOT, \
+  KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_K,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_ENT , \
+  ADJUST,  KC_LCTL, KC_LALT, KC_LGUI, LOWER,   KC_SPC,  KC_SPC,  RAISE,   KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT \
+),
+
+/* Dvorak
+ * ,-----------------------------------------------------------------------------------.
+ * | Tab  |   "  |   ,  |   .  |   P  |   Y  |   F  |   G  |   C  |   R  |   L  | Bksp |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Esc  |   A  |   O  |   E  |   U  |   I  |   D  |   H  |   T  |   N  |   S  |  /   |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift|   ;  |   Q  |   J  |   K  |   X  |   B  |   M  |   W  |   V  |   Z  |Enter |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |Adjust| Ctrl | Alt  | GUI  |Lower |Space |Space |Raise | Left | Down |  Up  |Right |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_DVORAK] = KEYMAP( \
+  KC_TAB,  KC_QUOT, KC_COMM, KC_DOT,  KC_P,    KC_Y,    KC_F,    KC_G,    KC_C,    KC_R,    KC_L,    KC_BSPC, \
+  KC_ESC,  KC_A,    KC_O,    KC_E,    KC_U,    KC_I,    KC_D,    KC_H,    KC_T,    KC_N,    KC_S,    KC_SLSH, \
+  KC_LSFT, KC_SCLN, KC_Q,    KC_J,    KC_K,    KC_X,    KC_B,    KC_M,    KC_W,    KC_V,    KC_Z,    KC_ENT , \
+  ADJUST,  KC_LCTL, KC_LALT, KC_LGUI, LOWER,   KC_SPC,  KC_SPC,  RAISE,   KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT \
+),
+
+/* Lower
+ * ,-----------------------------------------------------------------------------------.
+ * |   ~  |   !  |   @  |   #  |   $  |   %  |   ^  |   &  |   *  |   (  |   )  | Bksp |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Del  |  F1  |  F2  |  F3  |  F4  |  F5  |  F6  |   _  |   +  |     |    \  |  |   |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * |      |  F7  |  F8  |  F9  |  F10 |  F11 |  F12 |ISO ~ |ISO | |      |      |Enter |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |      |      |      |      |      |             |      | Next | Vol- | Vol+ | Play |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_LOWER] = KEYMAP( \
+  KC_TILD, KC_EXLM, KC_AT,   KC_HASH, KC_DLR,  KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \
+  KC_DEL,  KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,   KC_F6,   KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
+  _______, KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F11,  KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \
+  _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
+),
+
+/* Raise
+ * ,-----------------------------------------------------------------------------------.
+ * |   `  |   1  |   2  |   3  |   4  |   5  |   6  |   7  |   8  |   9  |   0  | Bksp |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Del  |  F1  |  F2  |  F3  |  F4  |  F5  |  F6  |   -  |   =  |   [  |   ]  |  \   |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * |      |  F7  |  F8  |  F9  |  F10 |  F11 |  F12 |ISO # |ISO / |      |      |Enter |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |      |      |      |      |      |             |      | Next | Vol- | Vol+ | Play |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_RAISE] = KEYMAP( \
+  KC_GRV,  KC_1,    KC_2,    KC_3,    KC_4,    KC_5,    KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_BSPC, \
+  KC_DEL,  KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,   KC_F6,   KC_MINS, KC_EQL,  KC_LBRC, KC_RBRC, KC_BSLS, \
+  _______, KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F11,  KC_F12,  KC_NUHS, KC_NUBS, _______, _______, _______, \
+  _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
+),
+
+/* Adjust (Lower + Raise)
+ * ,-----------------------------------------------------------------------------------.
+ * |      | Reset|      |      |      |      |      |      |      |      |      |  Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * |      |      |      |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|      |      |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * |      |      |      |      |      |      |      |      |      |      |      |      |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |      |      |      |      |      |             |      |      |      |      |      |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_ADJUST] =  KEYMAP( \
+  _______, RESET,   _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
+  _______, _______, _______, AU_ON,   AU_OFF,  AG_NORM, AG_SWAP, QWERTY,  COLEMAK, DVORAK,  _______, _______, \
+  _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+  _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
+)
+
+
+};
+
+#ifdef AUDIO_ENABLE
+float tone_qwerty[][2]     = SONG(QWERTY_SOUND);
+float tone_dvorak[][2]     = SONG(DVORAK_SOUND);
+float tone_colemak[][2]    = SONG(COLEMAK_SOUND);
+#endif
+
+void persistant_default_layer_set(uint16_t default_layer) {
+  eeconfig_update_default_layer(default_layer);
+  default_layer_set(default_layer);
+}
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+  switch (keycode) {
+    case QWERTY:
+      if (record->event.pressed) {
+        #ifdef AUDIO_ENABLE
+          PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
+        #endif
+        persistant_default_layer_set(1UL<<_QWERTY);
+      }
+      return false;
+      break;
+    case COLEMAK:
+      if (record->event.pressed) {
+        #ifdef AUDIO_ENABLE
+          PLAY_NOTE_ARRAY(tone_colemak, false, 0);
+        #endif
+        persistant_default_layer_set(1UL<<_COLEMAK);
+      }
+      return false;
+      break;
+    case DVORAK:
+      if (record->event.pressed) {
+        #ifdef AUDIO_ENABLE
+          PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
+        #endif
+        persistant_default_layer_set(1UL<<_DVORAK);
+      }
+      return false;
+      break;
+    case LOWER:
+      if (record->event.pressed) {
+        layer_on(_LOWER);
+        update_tri_layer(_LOWER, _RAISE, _ADJUST);
+      } else {
+        layer_off(_LOWER);
+        update_tri_layer(_LOWER, _RAISE, _ADJUST);
+      }
+      return false;
+      break;
+    case RAISE:
+      if (record->event.pressed) {
+        layer_on(_RAISE);
+        update_tri_layer(_LOWER, _RAISE, _ADJUST);
+      } else {
+        layer_off(_RAISE);
+        update_tri_layer(_LOWER, _RAISE, _ADJUST);
+      }
+      return false;
+      break;
+    case ADJUST:
+      if (record->event.pressed) {
+        layer_on(_ADJUST);
+      } else {
+        layer_off(_ADJUST);
+      }
+      return false;
+      break;
+  }
+  return true;
+}
\ No newline at end of file
index 1d768c59b32ed8e4c53a9ccf9d122fa05b28f7a4..13896900421f0654f29e75f46f9eeddc22ea1015 100644 (file)
@@ -28,14 +28,18 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "debug.h"
 #include "util.h"
 #include "matrix.h"
-#include "i2c.h"
-#include "serial.h"
 #include "split_util.h"
 #include "pro_micro.h"
 #include "config.h"
 
+#ifdef USE_I2C
+#  include "i2c.h"
+#else // USE_SERIAL
+#  include "serial.h"
+#endif
+
 #ifndef DEBOUNCE
-#   define DEBOUNCE    5
+#  define DEBOUNCE     5
 #endif
 
 #define ERROR_DISCONNECT_COUNT 5
@@ -145,6 +149,8 @@ uint8_t _matrix_scan(void)
     return 1;
 }
 
+#ifdef USE_I2C
+
 // Get rows from other half over i2c
 int i2c_transaction(void) {
     int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
@@ -176,7 +182,8 @@ i2c_error: // the cable is disconnceted, or something else went wrong
     return 0;
 }
 
-#ifndef USE_I2C
+#else // USE_SERIAL
+
 int serial_transaction(void) {
     int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
 
@@ -199,7 +206,7 @@ uint8_t matrix_scan(void)
 
 #ifdef USE_I2C
     if( i2c_transaction() ) {
-#else
+#else // USE_SERIAL
     if( serial_transaction() ) {
 #endif
         // turn on the indicator led when halves are disconnected
@@ -235,7 +242,7 @@ void matrix_slave_scan(void) {
         /* i2c_slave_buffer[i] = matrix[offset+i]; */
         i2c_slave_buffer[i] = matrix[offset+i];
     }
-#else
+#else // USE_SERIAL
     for (int i = 0; i < ROWS_PER_HAND; ++i) {
         serial_slave_buffer[i] = matrix[offset+i];
     }
@@ -290,7 +297,7 @@ static void  init_cols(void)
 static matrix_row_t read_cols(void)
 {
     matrix_row_t result = 0;
-    for(int x = 0; x < MATRIX_COLS; x++) {     
+    for(int x = 0; x < MATRIX_COLS; x++) {
         result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x);
     }
     return result;
@@ -298,7 +305,7 @@ static matrix_row_t read_cols(void)
 
 static void unselect_rows(void)
 {
-    for(int x = 0; x < ROWS_PER_HAND; x++) { 
+    for(int x = 0; x < ROWS_PER_HAND; x++) {
         _SFR_IO8((row_pins[x] >> 4) + 1) &=  ~_BV(row_pins[x] & 0xF);
         _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF);
     }
index 6961fbd556b9b3c7e69e9f7c924bd49ca86e54b7..6fde8a444ccae172391daa3847395fbf587db4b9 100644 (file)
@@ -52,7 +52,7 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
 OPT_DEFS += -DBOOTLOADER_SIZE=4096
 
 # Build Options
-#   change to "no" to disable the options, or define them in the Makefile in 
+#   change to "no" to disable the options, or define them in the Makefile in
 #   the appropriate keymap folder that will get included automatically
 #
 BOOTMAGIC_ENABLE ?= no       # Virtual DIP switch configuration(+1000)
@@ -71,4 +71,4 @@ RGBLIGHT_ENABLE ?= no        # Enable WS2812 RGB underlight.  Do not enable this
 # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
 SLEEP_LED_ENABLE ?= no    # Breathing sleep LED during USB suspend
 
-CUSTOM_MATRIX = yes
\ No newline at end of file
+CUSTOM_MATRIX = yes
index f439c2f20bf20d4b390af21e10a8a3676bd3ffcd..6faed09ce077c7b5d300b182d4705c8166e295fe 100644 (file)
 #include <avr/interrupt.h>
 #include <util/delay.h>
 #include <stdbool.h>
-
 #include "serial.h"
 
+#ifdef USE_SERIAL
+
 // Serial pulse period in microseconds. Its probably a bad idea to lower this
 // value.
 #define SERIAL_DELAY 24
@@ -223,3 +224,5 @@ int serial_update_buffers(void) {
   sei();
   return 0;
 }
+
+#endif
index 65003a71a46d6ea699eac1f4900ce499ba4e51ec..461921798f912215ac8b48173e424c9e641d39bd 100644 (file)
@@ -6,11 +6,15 @@
 #include <avr/eeprom.h>
 #include "split_util.h"
 #include "matrix.h"
-#include "i2c.h"
-#include "serial.h"
 #include "keyboard.h"
 #include "config.h"
 
+#ifdef USE_I2C
+#  include "i2c.h"
+#else
+#  include "serial.h"
+#endif
+
 volatile bool isLeftHand = true;
 
 static void setup_handedness(void) {
diff --git a/keyboards/planck/keymaps/impossible/Makefile b/keyboards/planck/keymaps/impossible/Makefile
new file mode 100644 (file)
index 0000000..581e08c
--- /dev/null
@@ -0,0 +1,25 @@
+
+
+# Build Options
+#   change to "no" to disable the options, or define them in the Makefile in 
+#   the appropriate keymap folder that will get included automatically
+#
+BOOTMAGIC_ENABLE = no       # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE = yes       # Mouse keys(+4700)
+EXTRAKEY_ENABLE = yes       # Audio control and System control(+450)
+CONSOLE_ENABLE = no         # Console for debug(+400)
+COMMAND_ENABLE = yes        # Commands for debug and configuration
+NKRO_ENABLE = yes            # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+BACKLIGHT_ENABLE = yes      # Enable keyboard backlight functionality
+MIDI_ENABLE = no            # MIDI controls
+AUDIO_ENABLE = yes           # Audio output on port C6
+UNICODE_ENABLE = no         # Unicode
+BLUETOOTH_ENABLE = no       # Enable Bluetooth with the Adafruit EZ-Key HID
+RGBLIGHT_ENABLE = no        # Enable WS2812 RGB underlight.  Do not enable this with audio at the same time.
+
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE = no    # Breathing sleep LED during USB suspend
+
+ifndef QUANTUM_DIR
+       include ../../../../Makefile
+endif
\ No newline at end of file
diff --git a/keyboards/planck/keymaps/impossible/keymap.c b/keyboards/planck/keymaps/impossible/keymap.c
new file mode 100644 (file)
index 0000000..503976f
--- /dev/null
@@ -0,0 +1,242 @@
+// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
+// this is the style you want to emulate.
+
+#include "planck.h"
+#include "action_layer.h"
+#ifdef AUDIO_ENABLE
+  #include "audio.h"
+#endif
+#include "eeconfig.h"
+
+extern keymap_config_t keymap_config;
+
+// Each layer gets a name for readability, which is then used in the keymap matrix below.
+// The underscores don't mean anything - you can have a layer called STUFF or any other name.
+// Layer names don't all need to be of the same length, obviously, and you can also skip them
+// entirely and just use numbers.
+
+#define _WORKMAN 0
+#define _FN 1
+#define _QWERTY 2
+#define _QW_FN 3
+#define _PLOVER 4
+#define _ADJ 5
+
+enum planck_keycodes {
+  WORKMAN = SAFE_RANGE,
+  QWERTY,
+  PLOVER
+};
+
+// Fillers to make layering more clear
+#define _______ KC_TRNS
+#define XXXXXXX KC_NO
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+/* Workman Alpha-numeric
+ * ,-----------------------------------------------------------------------------------------------.
+ * |   Q   |   D   |   R   |   W   |   B   |   F   |   U   |   P   |   J   |   7   |   8   |   9   |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * |   A   |   S   |   H   |   T   |   G   |   N   |   E   |   O   |   I   |   4   |   5   |   6   |
+ * |-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------|
+ * |   Z   |   X   |   M   |   C   |   V   |   L   |   Y   |   K   |   Up  |   1   |   2   |   3   |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * |Alt/Tab|Gui/Esc|   ,   |CTL/Bsp| Fn/Ent|SFT/SPC|   .   |  Left |  Down | Right |   0   |Adj/Ent|
+ * `-----------------------------------------------------------------------------------------------'
+ */
+
+[_WORKMAN] = {
+  {KC_Q,          KC_D,          KC_R,    KC_W,           KC_B,            KC_F,          KC_U,   KC_P,    KC_J,    KC_KP_7, KC_KP_8, KC_KP_9},
+  {KC_A,          KC_S,          KC_H,    KC_T,           KC_G,            KC_N,          KC_E,   KC_O,    KC_I,    KC_KP_4, KC_KP_5, KC_KP_6},
+  {KC_Z,          KC_X,          KC_M,    KC_C,           KC_V,            KC_L,          KC_Y,   KC_K,    KC_UP,   KC_KP_1, KC_KP_2, KC_KP_3},
+  {ALT_T(KC_TAB), GUI_T(KC_ESC), KC_COMM, CTL_T(KC_BSPC), LT(_FN, KC_ENT), SFT_T(KC_SPC), KC_DOT, KC_LEFT, KC_DOWN, KC_RGHT, KC_KP_0, LT(_ADJ, KC_ENT)}
+},
+
+/* FN-key held (Workman)
+ * ,-----------------------------------------------------------------------------------------------.
+ * |   !   |   @   |   #   |   $   |   %   |   ^   |   &   |   *   |  F12  |   F7  |   F8  |   F9  |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * |  Tab  |   [   |   ]   |   -   |  Del  |   '   |   (   |   )   |  F11  |   F4  |   F5  |   F6  |
+ * |-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------|
+ * |  Menu |       |       |   =   |   \   |   /   |       |       |  PgUp |   F1  |   F2  |   F3  |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * |Alt/Tab|  Gui  |   ~   |CTL/Bsp| Fn/Ent|SFT/Spc|   ;   |  Home |  PgDn |  End  |  F10  |Adj/Ent|
+ * `-----------------------------------------------------------------------------------------------'
+ */
+
+[_FN] = {
+  {KC_EXLM, KC_AT,       KC_HASH,     KC_DLR,   KC_PERC,   KC_CIRC, KC_AMPR,   KC_ASTR, KC_F12,  KC_F7,  KC_F8,  KC_F9},
+  {KC_TAB,  KC_LBRACKET, KC_RBRACKET, KC_MINUS, KC_DELETE, KC_QUOT, KC_LPRN,   KC_RPRN, KC_F11,  KC_F4,  KC_F5,  KC_F6},
+  {KC_MENU, _______,     _______,     KC_EQUAL, KC_BSLS,   KC_SLSH, XXXXXXX,   XXXXXXX, KC_PGUP, KC_F1,  KC_F2,  KC_F3},
+  {_______, KC_LGUI,     KC_GRAVE,    _______,  _______,   _______, KC_SCOLON, KC_HOME, KC_PGDN, KC_END, KC_F10, _______}
+},
+
+/* Qwerty
+ * ,-----------------------------------------------------------------------------------------------.
+ * |Gui/Esc|   1   |   2   |   3   |   4   |   5   |   6   |   7   |   8   |   9   |   0   | Bksp  |
+ * |-------+-------+-------+-------+-------+---------------+-------+-------+-------+-------+-------|
+ * | Ctrl  |   Q   |   W   |   E   |   R   |   T   |   Y   |   U   |   I   |   O   |   P   |   /   |
+ * |-------+-------+-------+-------+-------+---------------+-------+-------+-------+-------+-------|
+ * | Shift |   A   |   S   |   D   |   F   |   G   |   H   |   J   |   K   |   L   |   ;   |   "   |
+ * |-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------|
+ * |Alt/Tab|   Z   |   X   |   C   |   V   | Fn/SPC|   B   |   N   |   M   |   ,   |   .   |Adj/Ent|
+ * `-----------------------------------------------------------------------------------------------'
+ */
+
+[_QWERTY] = {
+  {GUI_T(KC_ESC), KC_1, KC_2, KC_3, KC_4, KC_5,               KC_6, KC_7, KC_8, KC_9,    KC_0,    KC_BSPC},
+  {KC_LCTL,       KC_Q, KC_W, KC_E, KC_R, KC_T,               KC_Y, KC_U, KC_I, KC_O,    KC_P,    KC_ENT},
+  {KC_LSFT,       KC_A, KC_S, KC_D, KC_F, KC_G,               KC_H, KC_J, KC_K, KC_L,    KC_SCLN, KC_QUOT},
+  {ALT_T(KC_TAB), KC_Z, KC_X, KC_C, KC_V, LT(_QW_FN, KC_SPC), KC_B, KC_N, KC_M, KC_COMM, KC_DOT,  LT(_ADJ, KC_ENT)},
+},
+
+/* FN-key held (Qwerty)
+ * ,-----------------------------------------------------------------------------------------------.
+ * |  Gui  |   F1  |   F2  |   F3  |   F4  |   F5  |   F6  |   F7  |   F8  |   F9  |  F10  |  F11  |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * |  Ctrl |   ~   |   [   |  PgUp |   ]   |       |       |   -   |   Up  |   =   |       |  F12  |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * | Shift |  Tab  |  Home |  PgDn |  End  |  Del  |       |  Left |  Down | Right |       |       |
+ * |-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------|
+ * |Alt/Tab|       |       |       |       | Fn/Spc|       |       |       |       |  Menu |Adj/Ent|
+ * `-----------------------------------------------------------------------------------------------'
+ */
+
+[_QW_FN] = {
+  {KC_LGUI, KC_F1,    KC_F2,   KC_F3,   KC_F4,   KC_F5,     KC_F6,   KC_F7,   KC_F8,   KC_F9,    KC_F10,  KC_F11},
+  {_______, KC_GRAVE, KC_LBRC, KC_PGUP, KC_RBRC, XXXXXXX,   XXXXXXX, KC_MINS, KC_UP,   KC_EQUAL, XXXXXXX, KC_F12},
+  {_______, KC_TAB,   KC_HOME, KC_PGDN, KC_END,  KC_DELETE, XXXXXXX, KC_LEFT, KC_DOWN, KC_RIGHT, XXXXXXX, XXXXXXX},
+  {_______, XXXXXXX,  XXXXXXX, XXXXXXX, XXXXXXX, _______,   XXXXXXX, _______, _______, _______,  KC_MENU, _______}
+},
+
+/* Plover layer (http://opensteno.org)
+ * ,-----------------------------------------------------------------------------------------------.
+ * |   S   |   T   |   P   |   H   |   *   |   F   |   P   |   L   |   T   |   D   |       |       |
+ * |-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------|
+ * |   S   |   K   |   W   |   R   |   *   |   R   |   B   |   G   |   S   |   Z   |       |       |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * |   #   |   #   |   #   |   #   |       |   #   |   #   |   #   |   #   |   #   |       |       |
+ * |-------+-------+-------+-------+-------+---------------+-------+-------+-------+-------+-------|
+ * |       |       |   A   |   O   |       |   E   |   U   |       |       |       |       |Adj/Ent|
+ * `-----------------------------------------------------------------------------------------------'
+ */
+
+[_PLOVER] = {
+  {KC_Q,    KC_W,    KC_E, KC_R, KC_T,    KC_U, KC_I, KC_O,    KC_P,    KC_LBRC, XXXXXXX, XXXXXXX},
+  {KC_A,    KC_S,    KC_D, KC_F, KC_G,    KC_J, KC_K, KC_L,    KC_SCLN, KC_QUOT, XXXXXXX, XXXXXXX},
+  {KC_1,    KC_1,    KC_1, KC_1, XXXXXXX, KC_1, KC_1, KC_1,    KC_1,    KC_1,    XXXXXXX, XXXXXXX},
+  {XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, LT(_ADJ, KC_ENT)}
+},
+
+/* Adjust
+ * ,-----------------------------------------------------------------------------------------------.
+ * |       |       |       |       |       |       |       |       | Insert| PrtSc | Pause | RESET |
+ * |-------+-------+-------+-------+-------+---------------+-------+-------+-------+-------+-------|
+ * |       |       |       |       |       |       |       | CapLk |Voice +| Audio |MIDIoff|       |
+ * |-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------|
+ * |       |       |       |       |       |       |       | ScrLk |Voice -| Music |MIDI on|       |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * |       |       |       |       |       |       |       | Numlk |Workman| Qwerty| Plover|Adj/Ent|
+ * `-----------------------------------------------------------------------------------------------'
+ */
+
+[_ADJ] = {
+  {_______, _______, _______, _______, _______, _______, _______, _______, KC_INS,  KC_PSCR, KC_PAUSE, RESET},
+  {_______, _______, _______, _______, _______, _______, _______, KC_CLCK, MUV_IN,  AU_TOG,  MI_OFF,   _______},
+  {_______, _______, _______, _______, _______, _______, _______, KC_SLCK, MUV_DE,  MU_TOG,  MI_ON,    _______},
+  {_______, _______, _______, _______, _______, _______, _______, KC_NLCK, WORKMAN, QWERTY,  PLOVER,   _______}
+}
+
+};
+
+#ifdef AUDIO_ENABLE
+
+float tone_startup[][2]    = SONG(STARTUP_SOUND);
+float tone_goodbye[][2]    = SONG(GOODBYE_SOUND);
+
+float tone_workman[][2]    = SONG(QWERTY_SOUND);
+float tone_qwerty[][2]     = SONG(COLEMAK_SOUND);
+float tone_plover[][2]     = SONG(PLOVER_SOUND);
+
+float music_scale[][2]     = SONG(MUSIC_SCALE_SOUND);
+
+#endif
+
+
+void persistant_default_layer_set(uint16_t default_layer) {
+  eeconfig_update_default_layer(default_layer);
+  default_layer_set(default_layer);
+}
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+  switch (keycode) {
+    case WORKMAN:
+      if (record->event.pressed) {
+        #ifdef AUDIO_ENABLE
+          PLAY_NOTE_ARRAY(tone_workman, false, 0);
+        #endif
+        persistant_default_layer_set(1UL<<_WORKMAN);
+      }
+      return false;
+      break;
+    case QWERTY:
+      if (record->event.pressed) {
+        #ifdef AUDIO_ENABLE
+          PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
+        #endif
+        persistant_default_layer_set(1UL<<_QWERTY);
+      }
+      return false;
+      break;
+    case PLOVER:
+      if (record->event.pressed) {
+        #ifdef AUDIO_ENABLE
+          PLAY_NOTE_ARRAY(tone_plover, false, 0);
+        #endif
+        if (!eeconfig_is_enabled()) {
+          eeconfig_init();
+        }
+        keymap_config.raw = eeconfig_read_keymap();
+        keymap_config.nkro = 1;
+        eeconfig_update_keymap(keymap_config.raw);
+        persistant_default_layer_set(1UL<<_PLOVER);
+      }
+      return false;
+      break;
+  }
+  return true;
+}
+
+void matrix_init_user(void) {
+    #ifdef AUDIO_ENABLE
+        startup_user();
+    #endif
+}
+
+#ifdef AUDIO_ENABLE
+
+void startup_user()
+{
+    _delay_ms(20); // gets rid of tick
+    PLAY_NOTE_ARRAY(tone_startup, false, 0);
+}
+
+void shutdown_user()
+{
+    PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
+    _delay_ms(150);
+    stop_all_notes();
+}
+
+void music_on_user(void)
+{
+    music_scale_user();
+}
+
+void music_scale_user(void)
+{
+    PLAY_NOTE_ARRAY(music_scale, false, 0);
+}
+
+#endif
diff --git a/keyboards/planck/keymaps/impossible/readme.md b/keyboards/planck/keymaps/impossible/readme.md
new file mode 100644 (file)
index 0000000..02c7191
--- /dev/null
@@ -0,0 +1,73 @@
+# The Impossible Layout
+
+The Impossible Layout is named such because it manages to fit in both a numpad and an inverted-T arrow cluster into the same layer as the alpha keys.
+
+## Main layout
+
+The Impossible Layout places the middle column of the alphas onto where the punctuation keys were, moving he most used punctuation to be accessed by the thumbs. Because removing the middle columns fits with the Workman layout's philosopy, Workman is used as the basis for the layout. This means the layout should be very easy to learn for Workman users, and reasonable for Colemak users. Other space gains are made by combining keys that are only ever chorded with other non symbol keys (with function-layer alternatives where needed).
+
+### Alpha-numeric layer
+
+|       |       |       |       |       |       |       |       |       |       |       |       |
+|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|
+|   Q   |   D   |   R   |   W   |   B   |   F   |   U   |   P   |   J   |   7   |   8   |   9   |
+|   A   |   S   |   H   |   T   |   G   |   N   |   E   |   O   |   I   |   4   |   5   |   6   |
+|   Z   |   X   |   M   |   C   |   V   |   L   |   Y   |   K   |   Up  |   1   |   2   |   3   |
+|Alt/Tab|Gui/Esc|   ,   |CTL/Bsp| Fn/Ent|SFT/SPC|   .   |  Left |  Down | Right |   0   |Adj/Ent|
+
+### Function layer
+
+|       |       |       |       |       |       |       |       |       |       |       |       |
+|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|
+|   !   |   @   |   #   |   $   |   %   |   ^   |   &   |   *   |  F12  |   F7  |   F8  |   F9  |
+|  Tab  |   [   |   ]   |   -   |  Del  |   '   |   (   |   )   |  F11  |   F4  |   F5  |   F6  |
+|  Menu |       |       |   =   |   \   |   /   |       |       |  PgUp |   F1  |   F2  |   F3  |
+|Alt/Tab|  Gui  |   ~   |CTL/Bsp| Fn/Ent|SFT/Spc|   ;   |  Home |  PgDn |  End  |  F10  |Adj/Ent|
+
+## Qwerty
+
+The Qwerty layer, mostly intended for gaming use, makes use of the doubled chorded/non-symbolic keys to obtain use of the entire alpha-numeric typing area.
+
+### Qwerty layer
+
+|       |       |       |       |       |       |       |       |       |       |       |       |
+|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|
+|Gui/Esc|   1   |   2   |   3   |   4   |   5   |   6   |   7   |   8   |   9   |   0   | Bksp  |
+| Ctrl  |   Q   |   W   |   E   |   R   |   T   |   Y   |   U   |   I   |   O   |   P   |   /   |
+| Shift |   A   |   S   |   D   |   F   |   G   |   H   |   J   |   K   |   L   |   ;   |   "   |
+|Alt/Tab|   Z   |   X   |   C   |   V   | Fn/SPC|   B   |   N   |   M   |   ,   |   .   |Adj/Ent|
+
+### Qwerty Fn Layer
+
+|       |       |       |       |       |       |       |       |       |       |       |       |
+|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|
+|  Gui  |   F1  |   F2  |   F3  |   F4  |   F5  |   F6  |   F7  |   F8  |   F9  |  F10  |  F11  |
+|  Ctrl |   ~   |   [   |  PgUp |   ]   |       |       |   -   |   Up  |   =   |       |  F12  |
+| Shift |  Tab  |  Home |  PgDn |  End  |  Del  |       |  Left |  Down | Right |       |       |
+|Alt/Tab|       |       |       |       | Fn/Spc|       |       |       |       |  Menu |Adj/Ent|
+
+## Stenography
+
+The Steno/Plover layer moves the number row below the regular keys, providing a much more comfortable placement for the thumb keys. Using this layout will require a slightly different dictionary to account for different keys being adjacent to the number row.
+
+### Steno Layer
+
+|       |       |       |       |       |       |       |       |       |       |       |       |
+|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|
+|   S   |   T   |   P   |   H   |   *   |   F   |   P   |   L   |   T   |   D   |       |       |
+|   S   |   K   |   W   |   R   |   *   |   R   |   B   |   G   |   S   |   Z   |       |       |
+|   #   |   #   |   #   |   #   |       |   #   |   #   |   #   |   #   |   #   |       |       |
+|       |       |   A   |   O   |       |   E   |   U   |       |       |       |       |Adj/Ent|
+
+## Adjustments and Options
+
+In order to switch between layouts and change other keyboard settings, an adjustment layer is accessible from the same position over any layout.
+
+### Adjustment Layer
+
+|       |       |       |       |       |       |       |       |       |       |       |       |
+|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|
+|       |       |       |       |       |       |       |       | Insert| PrtSc | Pause | RESET |
+|       |       |       |       |       |       |       | CapLk |Voice +| Audio |MIDIoff|       |
+|       |       |       |       |       |       |       | ScrLk |Voice -| Music |MIDI on|       |
+|       |       |       |       |       |       |       | Numlk |Workman| Qwerty| Plover|Adj/Ent|
diff --git a/keyboards/tada68/Makefile b/keyboards/tada68/Makefile
new file mode 100644 (file)
index 0000000..4e2a6f0
--- /dev/null
@@ -0,0 +1,3 @@
+ifndef MAKEFILE_INCLUDED
+       include ../../Makefile
+endif
\ No newline at end of file
diff --git a/keyboards/tada68/config.h b/keyboards/tada68/config.h
new file mode 100644 (file)
index 0000000..5d87579
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+Copyright 2012 Jun Wako <wakojun@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+#include "config_common.h"
+
+/* USB Device descriptor parameter */
+#define VENDOR_ID       0xFEED
+#define PRODUCT_ID      0x6060
+#define DEVICE_VER      0x0003
+#define MANUFACTURER    TADA
+#define PRODUCT         TADA68
+#define DESCRIPTION     QMK keyboard firmware for TADA68 with WS2812 support
+
+/* key matrix size */
+#define MATRIX_ROWS 5
+#define MATRIX_COLS 15
+
+// ROWS: Top to bottom, COLS: Left to right
+
+#define MATRIX_ROW_PINS {D0,D1,F6,F7,D5}
+#define MATRIX_COL_PINS {F0,F1,E6,C7,C6,B7,D4,B1,B0,B5,B4,D7,D6,B3,F4}
+#define UNUSED_PINS
+
+#define BACKLIGHT_PIN B6
+
+/* COL2ROW or ROW2COL */
+#define DIODE_DIRECTION COL2ROW
+
+/* define if matrix has ghost */
+//#define MATRIX_HAS_GHOST
+
+/* Set 0 if debouncing isn't needed */
+#define DEBOUNCING_DELAY 5
+
+/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
+#define LOCKING_SUPPORT_ENABLE
+/* Locking resynchronize hack */
+#define LOCKING_RESYNC_ENABLE
+
+/* key combination for command */
+#define IS_COMMAND() ( \
+    keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
+)
+
+/* Backlight configuration
+ */
+#define BACKLIGHT_LEVELS 4
+
+/* Underlight configuration
+ */
+
+/*#define RGB_DI_PIN E2
+#define RGBLIGHT_TIMER
+#define RGBLED_NUM 2     // Number of LEDs
+#define RGBLIGHT_HUE_STEP 10
+#define RGBLIGHT_SAT_STEP 17
+#define RGBLIGHT_VAL_STEP 17*/
+//Disabled while I figure out a suitable pin for RGB support.
+//I've tried F5, D2, D3, and E2 but it's possible the end of my
+//strand is bad. New LEDs on order.
+
+/*
+ * Feature disable options
+ *  These options are also useful to firmware size reduction.
+ */
+
+/* disable debug print */
+//#define NO_DEBUG
+
+/* disable print */
+//#define NO_PRINT
+
+/* disable action features */
+//#define NO_ACTION_LAYER
+//#define NO_ACTION_TAPPING
+//#define NO_ACTION_ONESHOT
+//#define NO_ACTION_MACRO
+//#define NO_ACTION_FUNCTION
+
+#endif
diff --git a/keyboards/tada68/keymaps/default/Makefile b/keyboards/tada68/keymaps/default/Makefile
new file mode 100644 (file)
index 0000000..2a7ff27
--- /dev/null
@@ -0,0 +1,21 @@
+# Build Options
+#   change to "no" to disable the options, or define them in the Makefile in 
+#   the appropriate keymap folder that will get included automatically
+#
+BOOTMAGIC_ENABLE = no       # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE = yes       # Mouse keys(+4700)
+EXTRAKEY_ENABLE = yes       # Audio control and System control(+450)
+CONSOLE_ENABLE = no         # Console for debug(+400)
+COMMAND_ENABLE = yes        # Commands for debug and configuration
+NKRO_ENABLE = yes           # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+BACKLIGHT_ENABLE = yes       # Enable keyboard backlight functionality
+MIDI_ENABLE = no            # MIDI controls
+AUDIO_ENABLE = no           # Audio output on port C6
+UNICODE_ENABLE = no         # Unicode
+BLUETOOTH_ENABLE = no       # Enable Bluetooth with the Adafruit EZ-Key HID
+RGBLIGHT_ENABLE = no        # Enable WS2812 RGB underlight.  Do not enable this with audio at the same time.
+SLEEP_LED_ENABLE = no       # Breathing sleep LED during USB suspend
+
+ifndef QUANTUM_DIR
+       include ../../../../Makefile
+endif
diff --git a/keyboards/tada68/keymaps/default/keymap.c b/keyboards/tada68/keymaps/default/keymap.c
new file mode 100644 (file)
index 0000000..da57c03
--- /dev/null
@@ -0,0 +1,98 @@
+#include "tada68.h"
+
+
+// Used for SHIFT_ESC
+#define MODS_CTRL_MASK  (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
+
+// Each layer gets a name for readability, which is then used in the keymap matrix below.
+// The underscores don't mean anything - you can have a layer called STUFF or any other name.
+// Layer names don't all need to be of the same length, obviously, and you can also skip them
+// entirely and just use numbers.
+#define _BL 0
+#define _FL 1
+
+#define _______ KC_TRNS
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+  /* Keymap _BL: (Base Layer) Default Layer
+   * ,----------------------------------------------------------------.
+   * |Esc | 1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Backsp |~ ` |
+   * |----------------------------------------------------------------|
+   * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|  \  |Del |
+   * |----------------------------------------------------------------|
+   * |CAPS   |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Return |PgUp|
+   * |----------------------------------------------------------------|
+   * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /|Shift | Up|PgDn|
+   * |----------------------------------------------------------------|
+   * |Ctrl|Win |Alt |        Space          |Alt| FN|Ctrl|Lef|Dow|Rig |
+   * `----------------------------------------------------------------'
+   */
+[_BL] = KEYMAP_ANSI(
+  KC_ESC,    KC_1,   KC_2,   KC_3,   KC_4,   KC_5,   KC_6,   KC_7,   KC_8,   KC_9,   KC_0,   KC_MINS, KC_EQL, KC_BSPC,KC_GRV, \
+  KC_TAB,  KC_Q,   KC_W,   KC_E,   KC_R,   KC_T,   KC_Y,   KC_U,   KC_I,   KC_O,   KC_P,   KC_LBRC, KC_RBRC,KC_BSLS,KC_DEL, \
+  KC_CAPS, KC_A,   KC_S,   KC_D,   KC_F,   KC_G,   KC_H,   KC_J,   KC_K,   KC_L,   KC_SCLN,KC_QUOT,         KC_ENT,KC_PGUP,  \
+  KC_LSFT,         KC_Z,   KC_X,   KC_C,   KC_V,   KC_B,   KC_N,   KC_M,   KC_COMM,KC_DOT, KC_SLSH,   KC_RSFT,KC_UP,KC_PGDN, \
+  KC_LCTL, KC_LGUI,KC_LALT,                KC_SPC,                        KC_RALT,MO(_FL),KC_RCTRL, KC_LEFT,KC_DOWN,KC_RGHT),
+
+  /* Keymap _FL: Function Layer
+   * ,----------------------------------------------------------------.
+   * |   |   |   |   |   |   |   |   |   |   |   |   |   |  RESET|    |
+   * |----------------------------------------------------------------|
+   * |     |   |   |   |   |   |   |   |   |   |   |BL-|BL+|BL   |    |
+   * |----------------------------------------------------------------|
+   * |      |   |   |   |   |   |   |       |   |   |   |        |    |
+   * |----------------------------------------------------------------|
+   * |        | F1|F2 | F3|F4 | F5| F6| F7| F8|   |   |      |   |    |
+   * |----------------------------------------------------------------|
+   * |    |    |    |                       |   |   |    |   |   |    |
+   * `----------------------------------------------------------------'
+   */
+[_FL] = KEYMAP_ANSI(
+  #ifdef RGBLIGHT_ENABLE
+  _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET,_______,  \
+  _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, BL_DEC,BL_INC, BL_TOGG,_______, \
+  _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,        _______,_______, \
+  _______,RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD,_______,_______,_______,_______,_______, \
+  _______,_______,_______,                 _______,               _______,_______,_______,_______,_______, _______),
+  #else
+  _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET,_______,  \
+  _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, BL_DEC,BL_INC, BL_TOGG,_______, \
+  _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,        _______,_______, \
+  _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \
+  _______,_______,_______,                 _______,               _______,_______,_______,_______,_______, _______),
+  #endif
+};
+
+/*enum function_id {
+    //SHIFT_ESC,
+};
+
+const uint16_t PROGMEM fn_actions[] = {
+  //[0]  = ACTION_FUNCTION(SHIFT_ESC),
+};
+
+void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
+  static uint8_t shift_esc_shift_mask;
+  switch (id) {
+    case SHIFT_ESC:
+      shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK;
+      if (record->event.pressed) {
+        if (shift_esc_shift_mask) {
+          add_key(KC_GRV);
+          send_keyboard_report();
+        } else {
+          add_key(KC_ESC);
+          send_keyboard_report();
+        }
+      } else {
+        if (shift_esc_shift_mask) {
+          del_key(KC_GRV);
+          send_keyboard_report();
+        } else {
+          del_key(KC_ESC);
+          send_keyboard_report();
+        }
+      }
+      break;
+  }
+}*/
diff --git a/keyboards/tada68/keymaps/default/readme.md b/keyboards/tada68/keymaps/default/readme.md
new file mode 100644 (file)
index 0000000..36760d6
--- /dev/null
@@ -0,0 +1 @@
+# default TADA68 layout
diff --git a/keyboards/tada68/readme.md b/keyboards/tada68/readme.md
new file mode 100644 (file)
index 0000000..552fdea
--- /dev/null
@@ -0,0 +1,4 @@
+TADA68 keyboard firmware
+======================
+
+TODO: to be updated.
diff --git a/keyboards/tada68/rules.mk b/keyboards/tada68/rules.mk
new file mode 100644 (file)
index 0000000..d8ec423
--- /dev/null
@@ -0,0 +1,66 @@
+
+# MCU name
+#MCU = at90usb1287
+MCU = atmega32u4
+
+# Processor frequency.
+#     This will define a symbol, F_CPU, in all source code files equal to the
+#     processor frequency in Hz. You can then use this symbol in your source code to
+#     calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+#     automatically to create a 32-bit value in your source code.
+#
+#     This will be an integer division of F_USB below, as it is sourced by
+#     F_USB after it has run through any CPU prescalers. Note that this value
+#     does not *change* the processor frequency - it should merely be updated to
+#     reflect the processor speed set externally so that the code can use accurate
+#     software delays.
+F_CPU = 16000000
+
+
+#
+# LUFA specific
+#
+# Target architecture (see library "Board Types" documentation).
+ARCH = AVR8
+
+# Input clock frequency.
+#     This will define a symbol, F_USB, in all source code files equal to the
+#     input clock frequency (before any prescaling is performed) in Hz. This value may
+#     differ from F_CPU if prescaling is used on the latter, and is required as the
+#     raw input clock is fed directly to the PLL sections of the AVR for high speed
+#     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
+#     at the end, this will be done automatically to create a 32-bit value in your
+#     source code.
+#
+#     If no clock division is performed on the input clock inside the AVR (via the
+#     CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
+F_USB = $(F_CPU)
+
+# Interrupt driven control endpoint task(+60)
+OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
+
+
+# Boot Section Size in *bytes*
+#   Teensy halfKay   512
+#   Teensy++ halfKay 1024
+#   Atmel DFU loader 4096
+#   LUFA bootloader  4096
+#   USBaspLoader     2048
+OPT_DEFS += -DBOOTLOADER_SIZE=4096
+
+
+# Build Options
+#   comment out to disable the options.
+#
+BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE ?= no  # Mouse keys(+4700)
+EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
+CONSOLE_ENABLE ?= yes  # Console for debug(+400)
+COMMAND_ENABLE ?= yes    # Commands for debug and configuration
+NKRO_ENABLE ?= yes             # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+RGBLIGHT_ENABLE ?= no   # Enable keyboard underlight functionality (+4870)
+BACKLIGHT_ENABLE ?= yes  # Enable keyboard backlight functionality (+1150)
+MIDI_ENABLE ?= no              # MIDI controls
+AUDIO_ENABLE ?= no
+UNICODE_ENABLE ?= no           # Unicode
+BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
diff --git a/keyboards/tada68/tada68.c b/keyboards/tada68/tada68.c
new file mode 100644 (file)
index 0000000..24f8904
--- /dev/null
@@ -0,0 +1,30 @@
+#include "tada68.h"
+#include "led.h"
+
+void matrix_init_kb(void) {
+       // put your keyboard start-up code here
+       // runs once when the firmware starts up
+       matrix_init_user();
+       led_init_ports();
+};
+
+void matrix_scan_kb(void) {
+       // put your looping keyboard code here
+       // runs every cycle (a lot)
+       matrix_scan_user();
+};
+
+void led_init_ports(void) {
+    // * Set our LED pins as output
+    DDRB |= (1<<2);
+}
+
+void led_set_kb(uint8_t usb_led) {
+       if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
+        // Turn capslock on
+        PORTB &= ~(1<<2);
+    } else {
+        // Turn capslock off
+        PORTB |= (1<<2);
+    }
+}
diff --git a/keyboards/tada68/tada68.h b/keyboards/tada68/tada68.h
new file mode 100644 (file)
index 0000000..d0e027a
--- /dev/null
@@ -0,0 +1,43 @@
+#ifndef TADA68_H
+#define TADA68_H
+
+#include "quantum.h"
+
+// readability
+#define XXX KC_NO
+
+/* TADA68 ANSI layout
+   * ,----------------------------------------------------------------.
+   * | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d    | 0e |
+   * |----------------------------------------------------------------|
+   * | 10  | 11| 12| 13| 14| 15| 16| 17| 18| 19| 1a| 1b| 1c|  1d | 1e |
+   * |----------------------------------------------------------------|
+   * | 20    | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2a| 2b| 2d    | 2e |
+   * |----------------------------------------------------------------|
+   * | 30     | 32| 33| 34| 35| 36| 37| 38| 39| 3a| 3b|    3c| 3d| 3e |
+   * |----------------------------------------------------------------|
+   * | 40 | 41 | 42 |        45             | 49| 4a|  4b| 4c| 4d| 4e |
+   * `----------------------------------------------------------------'
+ */
+// The first section contains all of the arguments
+// The second converts the arguments into a two-dimensional array
+
+#define KEYMAP_ANSI( \
+    k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \
+       k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \
+       k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b,      k2d, k2e, \
+       k30,      k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, \
+       k40, k41, k42,           k45,                k49, k4a, k4b, k4c, k4d, k4e  \
+) \
+{ \
+       {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e}, \
+       {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e}, \
+       {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d, k2e}, \
+       {k30, XXX, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e}, \
+       {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, k49, k4a, k4b, k4c, k4d, k4e}  \
+}
+
+void matrix_init_user(void);
+void matrix_scan_user(void);
+
+#endif
index 79ade4d0004f5691f7c77575e9e0d33ea0854f7c..6ae362c4c2f32487040ae5041afeccf16aa4cf39 100644 (file)
@@ -70,6 +70,7 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) {
       action->state.keycode = keycode;
       action->state.count++;
       action->state.timer = timer_read();
+      process_tap_dance_action_on_each_tap (action);
 
       if (last_td && last_td != keycode) {
         qk_tap_dance_action_t *paction = &tap_dance_actions[last_td - QK_TAP_DANCE];
index d7b857bdc64c8c5bff2f16dfc3c7d4ee8b55be1b..f753cbba665fd316dff284d8a0318a363505af79 100644 (file)
@@ -39,15 +39,17 @@ typedef struct
 
 #define ACTION_TAP_DANCE_DOUBLE(kc1, kc2) { \
     .fn = { NULL, qk_tap_dance_pair_finished, qk_tap_dance_pair_reset }, \
-    .user_data = (void *)&((qk_tap_dance_pair_t) { kc1, kc2 })  \
+    .user_data = (void *)&((qk_tap_dance_pair_t) { kc1, kc2 }),  \
   }
 
 #define ACTION_TAP_DANCE_FN(user_fn) {  \
-    .fn = { NULL, user_fn, NULL } \
+    .fn = { NULL, user_fn, NULL }, \
+    .user_data = NULL, \
   }
 
-#define ACTION_TAP_DANCE_FN_ADVANCED(user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_reset) { \
-    .fn = { user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_reset } \
+#define ACTION_TAP_DANCE_FN_ADVANCED(user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset) { \
+    .fn = { user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset }, \
+    .user_data = NULL, \
   }
 
 extern qk_tap_dance_action_t tap_dance_actions[];
index ea20b5e017ac461c9e67d1e5ace67190682bbc21..a7320202b24314727807b8ef3ebbd19308c2e354 100644 (file)
--- a/readme.md
+++ b/readme.md
@@ -526,7 +526,7 @@ This array specifies what actions shall be taken when a tap-dance key is in acti
 
 * `ACTION_TAP_DANCE_DOUBLE(kc1, kc2)`: Sends the `kc1` keycode when tapped once, `kc2` otherwise. When the key is held, the appropriate keycode is registered: `kc1` when pressed and held, `kc2` when tapped once, then pressed and held.
 * `ACTION_TAP_DANCE_FN(fn)`: Calls the specified function - defined in the user keymap - with the final tap count of the tap dance action.
-* `ACTION_TAP_DANCE_FN_ADVANCED(on_each_tap_fn, on_dance_finished_fn, on_reset_fn)`: Calls the first specified function - defined in the user keymap - on every tap, the second function on when the dance action finishes (like the previous option), and the last function when the tap dance action resets.
+* `ACTION_TAP_DANCE_FN_ADVANCED(on_each_tap_fn, on_dance_finished_fn, on_dance_reset_fn)`: Calls the first specified function - defined in the user keymap - on every tap, the second function on when the dance action finishes (like the previous option), and the last function when the tap dance action resets.
 
 The first option is enough for a lot of cases, that just want dual roles. For example, `ACTION_TAP_DANCE(KC_SPC, KC_ENT)` will result in `Space` being sent on single-tap, `Enter` otherwise.
 
index 08ef22eb970bc28f08244cb041b359063581cb19..d485b46c77cf83f81967d9af2060cd0f42fd3a66 100644 (file)
@@ -155,9 +155,10 @@ void process_action(keyrecord_t *record, action_t action)
                                                                 action.key.mods<<4;
                 if (event.pressed) {
                     if (mods) {
-                        if (IS_MOD(action.key.code)) {
+                        if (IS_MOD(action.key.code) || action.key.code == KC_NO) {
                             // e.g. LSFT(KC_LGUI): we don't want the LSFT to be weak as it would make it useless.
-                            // this also makes LSFT(KC_LGUI) behave exactly the same as LGUI(KC_LSFT)
+                            // This also makes LSFT(KC_LGUI) behave exactly the same as LGUI(KC_LSFT).
+                            // Same applies for some keys like KC_MEH which are declared as MEH(KC_NO).
                             add_mods(mods);
                         } else {
                             add_weak_mods(mods);
@@ -168,7 +169,7 @@ void process_action(keyrecord_t *record, action_t action)
                 } else {
                     unregister_code(action.key.code);
                     if (mods) {
-                        if (IS_MOD(action.key.code)) {
+                        if (IS_MOD(action.key.code) || action.key.code == KC_NO) {
                             del_mods(mods);
                         } else {
                             del_weak_mods(mods);