]> git.friedersdorff.com Git - max/tmk_keyboard.git/commitdiff
Layers reordered, according to Hasu's reccomendation + minor tweaks
authorOleg Kostyuk <cub.uanic@gmail.com>
Mon, 16 Sep 2013 01:47:50 +0000 (04:47 +0300)
committerOleg Kostyuk <cub.uanic@gmail.com>
Mon, 16 Sep 2013 02:56:21 +0000 (05:56 +0300)
keyboard/ergodox/keymap_cub.h
keyboard/ergodox/matrix.c

index 2fd932ad21b19efbc8e765f6f71f2893ddb092b0..86b6c794d54c58f73fdb3f1b45323e829f9286ba 100644 (file)
@@ -5,13 +5,13 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
      * ,--------------------------------------------------.           ,--------------------------------------------------.
      * |   ~    |   1  |   2  |   3  |   4  |   5  |   \  |           |   -  |   6  |   7  |   8  |   9  |   0  |   =    |
      * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
-     * | Tab    |   Q  |   W  |   E  |   R  |   T  | ~L1  |           | ~L3  |   Y  |   U  |   I  |   O  |   P  |   [    |
+     * | Tab    |   Q  |   W  |   E  |   R  |   T  | ~L5  |           | ~L6  |   Y  |   U  |   I  |   O  |   P  |   [    |
      * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
-     * | LShift |   A  |   S  |   D  |   F  |   G  |------|           |------|   H  |   J  |   K  |   L  |   ;  | ' FN14 |
-     * |--------+------+------+------+------+------|  L0  |           | ~L4  |------+------+------+------+------+--------|
-     * | LCtrl  |   Z  |   X  |   C  |   V  |   B  |      |           |      |   N  |   M  |   ,  |   .  |   /  | ] FN15 |
+     * | LShift |   A  |   S  |   D  |   F  |   G  |------|           |------|   H  |   J  |   K  |   L  |   ;  |   '    |
+     * |--------+------+------+------+------+------|  L0  |           | ~L7  |------+------+------+------+------+--------|
+     * | LCtrl  |   Z  |   X  |   C  |   V  |   B  |      |           |      |   N  |   M  |   ,  |   .  |   /  |   ]    |
      * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
-     *   | ~L1  | ~L2  | Caps | LAlt | LGui |                                       |  Lft |  Up  |  Dn  | Rght | ~L4  |
+     *   | ~L5  | ~L2  | Caps | LAlt | LGui |                                       |  Lft |  Up  |  Dn  | Rght | ~L6  |
      *   `----------------------------------'                                       `----------------------------------'
      *                                        ,-------------.       ,-------------.
      *                                        | +L2  | Home |       | PgUp | Del  |
@@ -39,8 +39,8 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
      * But sometimes I have to input something when XOrg is not active - for example, in Linux console,
      * or in firmware console (while debugging firmware), or when keyboard is connected to not my computer.
      *
-     * For such cases I have Layer5 :)
-     * // hint: switch to Layer5 is only at Layer4
+     * For such cases I have Layer1 :)
+     * // hint: switch to Layer1 is only at Layer6
      *
      ****************************************************************************************************
      *
@@ -51,13 +51,13 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
      * ,--------------------------------------------------.           ,--------------------------------------------------.
      * |   ~    |   ;  |   !  |   #  |   {  |   }  |   '  |           |   ^  |   [  |   ]  |   *  |   (  |   )  |   =    |
      * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
-     * | Tab    |   Q  |   D  |   R  |   W  |   B  | ~L1  |           | ~L3  |   J  |   F  |   U  |   P  |   $  |   :    |
+     * | Tab    |   Q  |   D  |   R  |   W  |   B  | ~L5  |           | ~L6  |   J  |   F  |   U  |   P  |   $  |   :    |
      * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
-     * | LShift |   A  |   S  |   H  |   T  |   G  |------|           |------|   Y  |   N  |   E  |   O  |   I  | - FN14 |
-     * |--------+------+------+------+------+------|  L0  |           | ~L4  |------+------+------+------+------+--------|
-     * | LCtrl  |   Z  |   X  |   M  |   C  |   V  |      |           |      |   K  |   L  |   ,  |   .  |   /  | | FN15 |
+     * | LShift |   A  |   S  |   H  |   T  |   G  |------|           |------|   Y  |   N  |   E  |   O  |   I  |   -    |
+     * |--------+------+------+------+------+------|  L0  |           | ~L7  |------+------+------+------+------+--------|
+     * | LCtrl  |   Z  |   X  |   M  |   C  |   V  |      |           |      |   K  |   L  |   ,  |   .  |   /  |   |    |
      * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
-     *   | ~L1  | ~L2  | Caps | LAlt | LGui |                                       |  Lft |  Up  |  Dn  | Rght | ~L4  |
+     *   | ~L5  | ~L2  | Caps | LAlt | LGui |                                       |  Lft |  Up  |  Dn  | Rght | ~L6  |
      *   `----------------------------------'                                       `----------------------------------'
      *                                        ,-------------.       ,-------------.
      *                                        | +L2  | Home |       | PgUp | Del  |
@@ -72,13 +72,13 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
      * ,--------------------------------------------------.           ,--------------------------------------------------.
      * |   `    |   1  |   2  |   3  |   4  |   5  |   "  |           |   \  |   6  |   7  |   8  |   9  |   0  |   +    |
      * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
-     * | Tab    |   Q  |   D  |   R  |   W  |   B  | ~L1  |           | ~L3  |   J  |   F  |   U  |   P  |   @  |   %    |
+     * | Tab    |   Q  |   D  |   R  |   W  |   B  | ~L5  |           | ~L6  |   J  |   F  |   U  |   P  |   @  |   %    |
      * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
-     * | LShift |   A  |   S  |   H  |   T  |   G  |------|           |------|   Y  |   N  |   E  |   O  |   I  | _ FN14 |
-     * |--------+------+------+------+------+------|  L0  |           | ~L4  |------+------+------+------+------+--------|
-     * | LCtrl  |   Z  |   X  |   M  |   C  |   V  |      |           |      |   K  |   L  |   ,  |   .  |   /  | & FN15 |
+     * | LShift |   A  |   S  |   H  |   T  |   G  |------|           |------|   Y  |   N  |   E  |   O  |   I  |   _    |
+     * |--------+------+------+------+------+------|  L0  |           | ~L7  |------+------+------+------+------+--------|
+     * | LCtrl  |   Z  |   X  |   M  |   C  |   V  |      |           |      |   K  |   L  |   ,  |   .  |   /  |   &    |
      * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
-     *   | ~L1  | ~L2  | Caps | LAlt | LGui |                                       |  Lft |  Up  |  Dn  | Rght | ~L4  |
+     *   | ~L5  | ~L2  | Caps | LAlt | LGui |                                       |  Lft |  Up  |  Dn  | Rght | ~L6  |
      *   `----------------------------------'                                       `----------------------------------'
      *                                        ,-------------.       ,-------------.
      *                                        | +L2  | Home |       | PgUp | Del  |
@@ -90,49 +90,49 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
      *
      */
 
-    KEYMAP(  // layout: layer 0: default
+    KEYMAP(  // Layer0: default, leftled:none
         // left hand
         GRV, 1,   2,   3,   4,   5,   BSLS,
-        TAB, Q,   W,   E,   R,   T,   FN1,
-        FN16,FN20,S,   D,   F,   G,
-        LCTL,Z,   X,   C,   FN19,B,   FN0,
-        FN1, FN6, CAPS,LALT,FN17,
-                                      FN2, HOME,
+        TAB, Q,   W,   E,   R,   T,   FN19,
+        FN11,FN25,FN24,D,   F,   G,
+        LCTL,Z,   X,   C,   FN23,B,   FN15,
+        FN19,FN18,CAPS,LALT,FN12,
+                                      FN17,HOME,
                                            END,
-                                 FN8, FN9, FN10,
+                                 FN5, FN6, FN7,
         // right hand
              MINS,6,   7,   8,   9,   0,   EQL,
-             FN3, Y,   U,   I,   O,   P,   LBRC,
-                  FN18,J,   K,   L,   FN21,FN14,
-             FN4, N,   M,   COMM,DOT, SLSH,FN15,
-                       LEFT,UP,  DOWN,RGHT,FN4,
+             FN20,Y,   U,   I,   O,   P,   LBRC,
+                  FN22,J,   K,   L,   FN26,FN13,
+             FN21,N,   M,   COMM,DOT, SLSH,FN14,
+                       LEFT,UP,  DOWN,RGHT,FN20,
         PGUP,DEL,
         PGDN,
-        FN11,FN12,FN13
+        FN8, FN9, FN10
     ),
 
-    KEYMAP(  // layout: layer 1: F-keys instead of numbers
+    KEYMAP(  // Layer1: Workman layout, leftled:all
         // left hand
-        TRNS,F1,  F2,  F3,  F4,  F5,  F6,
-        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
-        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
         TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
+        TRNS,Q,   D,   R,   W,   B,   TRNS,
+        TRNS,A,   S,   H,   T,   G,
+        TRNS,Z,   X,   M,   C,   V,   TRNS,
         TRNS,TRNS,TRNS,TRNS,TRNS,
                                       TRNS,TRNS,
                                            TRNS,
                                  TRNS,TRNS,TRNS,
         // right hand
-             F7,  F8,  F9,  F10, F11, F12, TRNS,
-             TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
-                  TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
              TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
+             TRNS,J,   F,   U,   P,   4,   TRNS,
+                  Y,   N,   E,   O,   I,   TRNS,
+             TRNS,K,   L,   TRNS,TRNS,TRNS,TRNS,
                        TRNS,TRNS,TRNS,TRNS,TRNS,
         TRNS,TRNS,
         TRNS,
         TRNS,TRNS,TRNS
     ),
 
-    KEYMAP(  // layout: layer 2: mouse + numpad
+    KEYMAP(  // Layer2: mouse + numpad, leftled:blue
         // left hand
         TRNS,NO,  NO,  NO,  NO,  PAUS,PSCR,
         TRNS,WH_L,WH_U,WH_D,WH_R,BTN2,TRNS,
@@ -153,94 +153,126 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
         TRNS,TRNS,TRNS
     ),
 
-    KEYMAP(  // layout: layer 3: F-keys only
+    KEYMAP(  // Layer3: F-keys + PgUp/PgDn on right hand, leftled:green
         // left hand
         TRNS,NO,  NO,  NO,  NO,  NO,  NO,
-        TRNS,F13, F14, F15, F16, NO,  TRNS,
-        TRNS,F17, F18, F19, F20, NO,
-        TRNS,F21, F22, F23, F24, NO,  TRNS,
-        TRNS,TRNS,TRNS,TRNS,TRNS,
+        TRNS,NO,  NO,  NO,  NO,  NO,  TRNS,
+        TRNS,NO,  TRNS,NO,  NO,  NO,
+        TRNS,NO,  NO,  NO,  NO,  NO,  TRNS,
+        TRNS,TRNS,TRNS,LALT,LGUI,
+                                      TRNS,TRNS,
+                                           TRNS,
+                                 LCTL,LSFT,TRNS,
+        // right hand
+             NO,  NO,  NO,  NO,  NO,  NO,  TRNS,
+             TRNS,NO,  F1,  F2,  F3,  F4,  PGUP,
+                  NO,  F5,  F6,  F7,  F8,  PGDN,
+             TRNS,NO,  F9,  F10, F11, F12, NO,
+                       RGUI,RALT,TRNS,TRNS,TRNS,
+        TRNS,TRNS,
+        TRNS,
+        TRNS,RSFT,RCTL
+    ),
+
+    KEYMAP(  // Layer4: unconvenient keys on right hand, leftled:red
+        // left hand
+        TRNS,NO,  NO,  NO,  NO,  NO,  NO,
+        TRNS,NO,  NO,  NO,  NO,  NO,  TRNS,
+        TRNS,TRNS,NO,  NO,  NO,  NO,
+        TRNS,NO,  NO,  NO,  NO,  NO,  TRNS,
+        TRNS,TRNS,TRNS,LALT,LGUI,
                                       TRNS,TRNS,
                                            TRNS,
                                  TRNS,TRNS,TRNS,
+
+        // in Workman this will be:
+        //              =
+        //      { } ( ) +
+        //      ' " ^ ^ \
+        //      [ < > ] \
+
         // right hand
              NO,  NO,  NO,  NO,  NO,  NO,  TRNS,
-             TRNS,NO,  F1,  F2,  F3,  F4,  TRNS,
-                  NO,  F5,  F6,  F7,  F8,  TRNS,
-             TRNS,NO,  F9,  F10, F11, F12, TRNS,
+             TRNS,NO,  4,   5,   9,   0,   PPLS,
+                  NO,  BSLS,FN1, MINS,MINS,FN2,
+             TRNS,NO,  6,   FN3, FN4, 7,   FN2,
                        TRNS,TRNS,TRNS,TRNS,TRNS,
         TRNS,TRNS,
         TRNS,
         TRNS,TRNS,TRNS
     ),
 
-    KEYMAP(  // layout: layer 4: F-keys + cursor
+    KEYMAP(  // Layer5: F-keys instead of numbers, leftled:red
         // left hand
         TRNS,F1,  F2,  F3,  F4,  F5,  F6,
-        FN7, NO,  PGUP,UP,  PGDN,PGUP,TRNS,
-        TRNS,NO,  LEFT,DOWN,RGHT,PGDN,
-        TRNS,NO,  NO,  END, HOME,NO,  TRNS,
-        FN5, TRNS,TRNS,TRNS,TRNS,
+        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
+        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
+        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
+        TRNS,TRNS,TRNS,TRNS,TRNS,
                                       TRNS,TRNS,
                                            TRNS,
                                  TRNS,TRNS,TRNS,
         // right hand
-             F7,  F8,  F9,  F10, F11, F12, MINS,
-             TRNS,PGUP,PGUP,UP,  PGDN,NO,  FN7,
-                  PGDN,LEFT,DOWN,RGHT,NO,  TRNS,
-             TRNS,NO,  HOME,END, NO,  NO,  TRNS,
+             F7,  F8,  F9,  F10, F11, F12, TRNS,
+             TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
+                  TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
+             TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
                        TRNS,TRNS,TRNS,TRNS,TRNS,
         TRNS,TRNS,
         TRNS,
         TRNS,TRNS,TRNS
     ),
 
-    KEYMAP(  // layout: layer 5: Workman layout
+    KEYMAP(  // Layer6: F-keys, cursor, Workman-layer switch, Teensy, leftled:red+onboard
         // left hand
-        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
-        TRNS,Q,   D,   R,   W,   B,   TRNS,
-        TRNS,A,   S,   H,   T,   G,
-        TRNS,Z,   X,   M,   C,   V,   TRNS,
-        TRNS,TRNS,TRNS,TRNS,TRNS,
+        TRNS,F1,  F2,  F3,  F4,  F5,  F6,
+        FN0, NO,  PGUP,UP,  PGDN,PGUP,TRNS,
+        TRNS,NO,  LEFT,DOWN,RGHT,PGDN,
+        TRNS,NO,  NO,  END, HOME,NO,  TRNS,
+        FN16,TRNS,TRNS,TRNS,TRNS,
                                       TRNS,TRNS,
                                            TRNS,
                                  TRNS,TRNS,TRNS,
         // right hand
-             TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
-             TRNS,J,   F,   U,   P,   4,   TRNS,
-                  Y,   N,   E,   O,   I,   TRNS,
-             TRNS,K,   L,   TRNS,TRNS,TRNS,TRNS,
+             F7,  F8,  F9,  F10, F11, F12, MINS,
+             TRNS,PGUP,PGUP,UP,  PGDN,NO,  FN0,
+                  PGDN,LEFT,DOWN,RGHT,NO,  TRNS,
+             TRNS,NO,  HOME,END, NO,  NO,  TRNS,
                        TRNS,TRNS,TRNS,TRNS,TRNS,
         TRNS,TRNS,
         TRNS,
         TRNS,TRNS,TRNS
     ),
 
-    KEYMAP(  // layout: layer 6: F-keys on home+1 row
+    //
+    // rarely used
+    //
+
+    KEYMAP(  // Layer7: F-keys only
         // left hand
         TRNS,NO,  NO,  NO,  NO,  NO,  NO,
-        TRNS,F1,  F2,  F3,  F4,  F5,  F11,
-        TRNS,TRNS,NO,  NO,  NO,  NO,
-        TRNS,NO,  NO,  NO,  NO,  NO,  TRNS,
-        TRNS,TRNS,TRNS,LALT,LGUI,
+        TRNS,F13, F14, F15, F16, NO,  TRNS,
+        TRNS,F17, F18, F19, F20, NO,
+        TRNS,F21, F22, F23, F24, NO,  TRNS,
+        TRNS,TRNS,TRNS,TRNS,TRNS,
                                       TRNS,TRNS,
                                            TRNS,
-                                 LCTL,LSFT,TRNS,
+                                 TRNS,TRNS,TRNS,
         // right hand
              NO,  NO,  NO,  NO,  NO,  NO,  TRNS,
-             F12, F6,  F7,  F8,  F9,  F10, PGUP,
-                  NO,  NO,  NO,  NO,  TRNS,PGDN,
-             TRNS,NO,  NO,  NO,  NO,  NO,  TRNS,
-                       RGUI,RALT,TRNS,TRNS,TRNS,
+             TRNS,NO,  F1,  F2,  F3,  F4,  TRNS,
+                  NO,  F5,  F6,  F7,  F8,  TRNS,
+             TRNS,NO,  F9,  F10, F11, F12, TRNS,
+                       TRNS,TRNS,TRNS,TRNS,TRNS,
         TRNS,TRNS,
         TRNS,
-        TRNS,RSFT,RCTL
+        TRNS,TRNS,TRNS
     ),
 
-    KEYMAP(  // layout: layer 7: F-keys on right hand
+    KEYMAP(  // Layer8: F-keys on home+1 row
         // left hand
         TRNS,NO,  NO,  NO,  NO,  NO,  NO,
-        TRNS,NO,  NO,  NO,  NO,  NO,  TRNS,
+        TRNS,F1,  F2,  F3,  F4,  F5,  F11,
         TRNS,TRNS,NO,  NO,  NO,  NO,
         TRNS,NO,  NO,  NO,  NO,  NO,  TRNS,
         TRNS,TRNS,TRNS,LALT,LGUI,
@@ -249,9 +281,9 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
                                  LCTL,LSFT,TRNS,
         // right hand
              NO,  NO,  NO,  NO,  NO,  NO,  TRNS,
-             TRNS,MINS,F1,  F2,  F3,  F4,  PGUP,
-                  BSLS,F5,  F6,  F7,  F8,  PGDN,
-             TRNS,FN22,F9,  F10, F11, F12, FN23,
+             F12, F6,  F7,  F8,  F9,  F10, PGUP,
+                  NO,  NO,  NO,  NO,  TRNS,PGDN,
+             TRNS,NO,  NO,  NO,  NO,  NO,  TRNS,
                        RGUI,RALT,TRNS,TRNS,TRNS,
         TRNS,TRNS,
         TRNS,
@@ -261,7 +293,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
 /*
     // templates to copy from
 
-    KEYMAP(  // layout: layer N: transparent on edges, all others are empty
+    KEYMAP(  // LayerN: transparent on edges + hard-defined thumb keys, all others are empty
         // left hand
         TRNS,NO,  NO,  NO,  NO,  NO,  NO,
         TRNS,NO,  NO,  NO,  NO,  NO,  TRNS,
@@ -281,7 +313,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
         TRNS,
         TRNS,RSFT,RCTL
     ),
-    KEYMAP(  // layout: layer N: fully transparent
+    KEYMAP(  // LayerN: fully transparent
         // left hand
         TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
         TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
@@ -314,33 +346,39 @@ enum function_id {
  * Fn action definition
  */
 static const uint16_t PROGMEM fn_actions[] = {
-    ACTION_LAYER_SET(0, ON_BOTH),                   // FN0 - switch to Layer0
-    ACTION_LAYER_MOMENTARY(1),                      // FN1 - push Layer1
-    ACTION_LAYER_SET(2, ON_BOTH),                   // FN2 - switch to Layer2
-    ACTION_LAYER_MOMENTARY(3),                      // FN3 - push Layer3
-    ACTION_LAYER_MOMENTARY(4),                      // FN4 - push Layer4
-    ACTION_LAYER_SET(5, ON_BOTH),                   // FN5 - switch to Layer5
-    ACTION_LAYER_MOMENTARY(2),                      // FN6 - push Layer2
-    ACTION_FUNCTION(TEENSY_KEY),                    // FN7 - Teensy key
+    ACTION_FUNCTION(TEENSY_KEY),                    // FN0  - Teensy key
+
+    ACTION_MODS_KEY(MOD_LSFT, KC_BSLS),             // FN1  = Shifted BackSlash // " in Workman
+    ACTION_MODS_KEY(MOD_LSFT, KC_MINS),             // FN2  = Shifted Minus     // \ in Workman
+    ACTION_MODS_KEY(MOD_LSFT, KC_COMM),             // FN3  = Shifted comma     // < in Workman
+    ACTION_MODS_KEY(MOD_LSFT, KC_DOT),              // FN4  = Shifted dot       // > in Workman
+
+    ACTION_MODS_TAP_KEY(MOD_LCTL, KC_BSPC),         // FN5  = LShift with tap BackSpace
+    ACTION_MODS_TAP_KEY(MOD_LSFT, KC_ESC),          // FN6  = LCtrl  with tap Escape
+    ACTION_MODS_TAP_KEY(MOD_LALT, KC_SPC),          // FN7  = LAlt   with tap Space
+    ACTION_MODS_TAP_KEY(MOD_RALT, KC_INS),          // FN8  = RAlt   with tap Ins
+    ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT),          // FN9  = RShift with tap Enter
+    ACTION_MODS_TAP_KEY(MOD_RCTL, KC_SPC),          // FN10 = RCtrl  with tap Space
+
+    ACTION_MODS_TAP_KEY(MOD_LSFT, KC_TAB),          // FN11 = LShift with tap Tab
+    ACTION_MODS_TAP_KEY(MOD_LGUI, KC_ESC),          // FN12 = LGui   with tap Escape
+    ACTION_MODS_TAP_KEY(MOD_RSFT, KC_QUOT),         // FN13 = RShift with tap quotes
+    ACTION_MODS_TAP_KEY(MOD_RCTL, KC_RBRC),         // FN14 = RCtrl  with tap ]
 
-    ACTION_MODS_TAP_KEY(MOD_LCTL, KC_BSPC),         // FN8  = LShift with tap BackSpace
-    ACTION_MODS_TAP_KEY(MOD_LSFT, KC_ESC),          // FN9  = LCtrl with tap Escape
-    ACTION_MODS_TAP_KEY(MOD_LALT, KC_SPC),          // FN10 = LAlt with tap Space
-    ACTION_MODS_TAP_KEY(MOD_RALT, KC_INS),          // FN11 = RAlt with tap Ins
-    ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT),          // FN12 = RShift with tap Enter
-    ACTION_MODS_TAP_KEY(MOD_RCTL, KC_SPC),          // FN13 = RCtrl with tap Space
-    ACTION_MODS_TAP_KEY(MOD_RSFT, KC_QUOT),         // FN14 = RShift with tap quotes
-    ACTION_MODS_TAP_KEY(MOD_RCTL, KC_RBRC),         // FN15 = RCtrl with tap ]
-    ACTION_MODS_TAP_KEY(MOD_LSFT, KC_TAB),          // FN16 = LShift with tap Tab
-    ACTION_MODS_TAP_KEY(MOD_LGUI, KC_ESC),          // FN17 = LShift with tap Escape
+    ACTION_LAYER_SET(0, ON_BOTH),                   // FN15 - set Layer0
+    ACTION_LAYER_SET(1, ON_BOTH),                   // FN16 - set Layer1, to use Workman layout at firmware level
+    ACTION_LAYER_SET(2, ON_BOTH),                   // FN17 - set Layer2, to use with Numpad keys
 
-    ACTION_LAYER_TAP_KEY(2, KC_H),                  // FN18 = L2 symbols on H key, to use with Mouse keys
-    ACTION_LAYER_TAP_KEY(2, KC_V),                  // FN19 = L2 symbols on V key, to use with Numpad keys
-    ACTION_LAYER_TAP_KEY(7, KC_A),                  // FN20 = L7 symbols on A key, to use with F* keys
-    ACTION_LAYER_TAP_KEY(6, KC_SCLN),               // FN21 = L6 symbols on ; key, to use with F* keys
+    ACTION_LAYER_MOMENTARY(2),                      // FN18 - momentary Layer2, to use with Numpad keys
+    ACTION_LAYER_MOMENTARY(5),                      // FN19 - momentary Layer5, to use with F* keys on top row
+    ACTION_LAYER_MOMENTARY(6),                      // FN20 - momentary Layer6, to use with F* keys, cursor, Teensy, Workman-layer switch
+    ACTION_LAYER_MOMENTARY(7),                      // FN21 - momentary Layer7, to use with F* keys (F1-F24)
 
-    ACTION_MODS_KEY(MOD_LSFT, KC_BSLS),             // FN22 = Shifted BackSlash // " in Workman
-    ACTION_MODS_KEY(MOD_LSFT, KC_MINS),             // FN23 = Shifted Minus     // \ in Workman
+    ACTION_LAYER_TAP_KEY(2, KC_H),                  // FN22 = momentary Layer2 on H key, to use with Mouse keys
+    ACTION_LAYER_TAP_KEY(2, KC_V),                  // FN23 = momentary Layer2 on V key, to use with Numpad keys
+    ACTION_LAYER_TAP_KEY(3, KC_S),                  // FN24 = momentary Layer3 on S key, to use with F* keys
+    ACTION_LAYER_TAP_KEY(4, KC_A),                  // FN25 = momentary Layer4 on A key, to use with unconvenient keys
+    ACTION_LAYER_TAP_KEY(8, KC_SCLN),               // FN26 = momentary Layer8 on ; key, to use with F* keys on home+1 row
 };
 
 void action_function(keyrecord_t *event, uint8_t id, uint8_t opt)
index 0c5b73113f5d64bd87f90fdd4b7a8585b01df592..90c129d0389050c8567822e33abe5d566c5c7588 100644 (file)
@@ -105,43 +105,45 @@ uint8_t matrix_scan(void)
 #ifdef KEYMAP_CUB
     uint8_t layer = biton32(layer_state);
 
-    if (layer == 1) {
-        ergodox_left_led_1_on();
-        ergodox_left_led_2_off();
-        ergodox_left_led_3_off();
-    } else if (layer == 2) {
-        ergodox_left_led_1_off();
-        ergodox_left_led_2_on();
-        ergodox_left_led_3_off();
-    } else if (layer == 3) {
-        ergodox_left_led_1_off();
-        ergodox_left_led_2_off();
-        ergodox_left_led_3_on();
-    } else if (layer == 4) {
-        ergodox_left_led_1_on();
-        ergodox_left_led_2_off();
-        ergodox_left_led_3_on();
-    } else if (layer == 5) {
-        ergodox_left_led_1_on();
-        ergodox_left_led_2_on();
-        ergodox_left_led_3_off();
-    } else if (layer == 6) {
-        ergodox_left_led_1_off();
-        ergodox_left_led_2_on();
-        ergodox_left_led_3_on();
-    } else if (layer == 7) {
-        ergodox_left_led_1_on();
-        ergodox_left_led_2_on();
-        ergodox_left_led_3_on();
-    } else {
-        ergodox_left_led_1_off();
-        ergodox_left_led_2_off();
-        ergodox_left_led_3_off();
+    ergodox_board_led_off();
+    switch (layer) {
+        case 1:
+            // all
+            ergodox_left_led_1_on();
+            ergodox_left_led_2_on();
+            ergodox_left_led_3_on();
+            break;
+        case 2:
+            // blue
+            ergodox_left_led_1_off();
+            ergodox_left_led_2_on();
+            ergodox_left_led_3_off();
+            break;
+        case 3:
+            // green
+            ergodox_left_led_1_off();
+            ergodox_left_led_2_off();
+            ergodox_left_led_3_on();
+            break;
+        case 6:
+            ergodox_board_led_on();
+            // break missed intentionally
+        case 4:
+        case 5:
+            // red
+            ergodox_left_led_1_on();
+            ergodox_left_led_2_off();
+            ergodox_left_led_3_off();
+            break;
+        default:
+            // none
+            ergodox_left_led_1_off();
+            ergodox_left_led_2_off();
+            ergodox_left_led_3_off();
+            break;
     }
 
-    // not actually needed because we already calling init_mcp23018() in next line
     mcp23018_status = ergodox_left_leds_update();
-
 #endif
 
     for (uint8_t i = 0; i < MATRIX_ROWS; i++) {