Split fn layer from numbers layer to better match the TM behaviour
- removed access to layer 2 from ";" key - "fn" key toggles both layers 1 & 2 - replaced media and mouse layer by fn layer - renamed symbol layer to numbers layer - moved all F-keys together on left hand
This commit is contained in:
parent
38a0e62a10
commit
bfda6ee417
@ -10,11 +10,12 @@
|
|||||||
* - ] is moved in place of the dash (-)
|
* - ] is moved in place of the dash (-)
|
||||||
* - dash (-) and = are moved on bottom right row
|
* - dash (-) and = are moved on bottom right row
|
||||||
* - arrows and PgUp/PgDn are moved on the thumbs
|
* - arrows and PgUp/PgDn are moved on the thumbs
|
||||||
* Layer 1: "Fn"-layer close to the TM with the following differences:
|
* Layer 1: numbers layer close to the TM when toggling "num" with the following differences:
|
||||||
* - provides access to F1-F12
|
* - numpad is displaced by 1 to the top left
|
||||||
* - VolUp & VolDn are only on left hand
|
* - arrows are displaced by 1 to the left
|
||||||
* - arrows & numpad are displaced by 1 to the top left
|
* - provides access to F1-F12, caps lock and num lock
|
||||||
* Layer 2: TODO -- currently kept as in the default ErgoDox EZ layout
|
* Layer 2: "fn" layer ("fn" key toggles both layers 1 & 2) with the following differences:
|
||||||
|
* - VolUp & VolDn are only on left hand to keep access to arrows on right hand
|
||||||
* Leds:
|
* Leds:
|
||||||
* - left (1st) & middle (2nd) leds are used to indicate layers 1 & 2 respectively
|
* - left (1st) & middle (2nd) leds are used to indicate layers 1 & 2 respectively
|
||||||
* - right (3rd) led is used to indicate caps-lock
|
* - right (3rd) led is used to indicate caps-lock
|
||||||
@ -25,8 +26,8 @@
|
|||||||
#include "led.h"
|
#include "led.h"
|
||||||
|
|
||||||
#define BASE 0 // default layer
|
#define BASE 0 // default layer
|
||||||
#define SYMB 1 // symbols
|
#define NMBR 1 // numbers layer
|
||||||
#define MDIA 2 // media keys
|
#define FNLR 2 // fn layer
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
/* Keymap 0: Basic layer
|
/* Keymap 0: Basic layer
|
||||||
@ -36,11 +37,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||||
* | Tab | Q | W | E | R | T |Backsp| |Backsp| Y | U | I | O | P | [ |
|
* | Tab | Q | W | E | R | T |Backsp| |Backsp| Y | U | I | O | P | [ |
|
||||||
* |--------+------+------+------+------+------|ace | |ace |------+------+------+------+------+--------|
|
* |--------+------+------+------+------+------|ace | |ace |------+------+------+------+------+--------|
|
||||||
* | LShift | A | S | D | F | G |------| |------| H | J | K | L |; / L2| '/Shift|
|
* | LShift | A | S | D | F | G |------| |------| H | J | K | L | ; | '/Shift|
|
||||||
* |--------+------+------+------+------+------|Enter | |Enter |------+------+------+------+------+--------|
|
* |--------+------+------+------+------+------|Enter | |Enter |------+------+------+------+------+--------|
|
||||||
* | LShift | Z | X | C | V | B | | | | N | M | , | . | / | \/Shift|
|
* | LShift | Z | X | C | V | B | | | | N | M | , | . | / | \/Shift|
|
||||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||||
* |LCtrl | ~L1 | LGui | Play |App/Alt| | RAlt | - | Home | = |End/Ctl|
|
* |LCtrl | fn | LGui | Play |App/Alt| | RAlt | - | Home | = |End/Ctl|
|
||||||
* `-----------------------------------' `-----------------------------------'
|
* `-----------------------------------' `-----------------------------------'
|
||||||
* ,--------------. ,-------------.
|
* ,--------------. ,-------------.
|
||||||
* |Esc/Alt| L1 | | Left |Right |
|
* |Esc/Alt| L1 | | Left |Right |
|
||||||
@ -58,7 +59,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_BSPC,
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_BSPC,
|
||||||
KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G,
|
KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G,
|
||||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_ENT,
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_ENT,
|
||||||
KC_LCTL, KC_FN1, KC_LGUI,KC_MPLY,ALT_T(KC_APP),
|
KC_LCTL, M(2), KC_LGUI,KC_MPLY,ALT_T(KC_APP),
|
||||||
|
|
||||||
ALT_T(KC_ESC), TG(1),
|
ALT_T(KC_ESC), TG(1),
|
||||||
KC_PGUP,
|
KC_PGUP,
|
||||||
@ -67,47 +68,47 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
// right hand
|
// right hand
|
||||||
KC_DELT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_RBRC,
|
KC_DELT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_RBRC,
|
||||||
KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
|
KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
|
||||||
KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),SFT_T(KC_QUOT),
|
KC_H, KC_J, KC_K, KC_L, KC_SCLN, SFT_T(KC_QUOT),
|
||||||
KC_ENT, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, SFT_T(KC_BSLS),
|
KC_ENT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_BSLS),
|
||||||
KC_RALT,KC_MINS,KC_HOME,KC_EQL, CTL_T(KC_END),
|
KC_RALT, KC_MINS, KC_HOME, KC_EQL, CTL_T(KC_END),
|
||||||
|
|
||||||
KC_LEFT, KC_RGHT,
|
KC_LEFT, KC_RGHT,
|
||||||
KC_UP,
|
KC_UP,
|
||||||
KC_DOWN, KC_SPC, KC_SPC
|
KC_DOWN, KC_SPC, KC_SPC
|
||||||
),
|
),
|
||||||
/* Keymap 1: Symbol Layer
|
/* Keymap 1: Numbers Layer
|
||||||
*
|
*
|
||||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||||
* | | F1 | F2 | F3 | F4 | F5 |Insert| |Insert| F6 | F7 | Tab | / | * | - |
|
* | | F1 | F2 | F3 | F4 | F5 | | | | | | Tab | / | * | - |
|
||||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||||
* | | F8 | F9 | F10 | F11 | F12 |VolUp | | | | Home | 7 | 8 | 9 | + |
|
* | | F6 | F7 | F8 | F9 | F10 | | | | | Home | 7 | 8 | 9 | + |
|
||||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||||
* | | | | | | |------| |------| Up | End | 4 | 5 | 6 | + |
|
* | | F11 | F12 | | | |------| |------| Up | End | 4 | 5 | 6 | + |
|
||||||
* |--------+------+------+------+------+------|VolDn | | |------+------+------+------+------+--------|
|
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||||
* | | | cut | copy |paste | Mute | | | Left | Down | Right| 1 | 2 | 3 |KpEnter |
|
* | | | | | | | | | Left | Down | Right| 1 | 2 | 3 |KpEnter |
|
||||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||||
* | | | | | | | | 0 | 00 | . |Etr/Ctl|
|
* | | | | | | | | 0 | 00 | . |Etr/Ctl|
|
||||||
* `----------------------------------' `-----------------------------------'
|
* `----------------------------------' `-----------------------------------'
|
||||||
* ,-------------. ,-------------.
|
* ,-------------. ,-------------.
|
||||||
* | | | |n.lock|c.lock|
|
* | | | |n.lock|c.lock|
|
||||||
* ,------|------|------| |------+------+------.
|
* ,------|------|------| |------+------+------.
|
||||||
* | | | | | Next | | |
|
* | | | | | | | |
|
||||||
* | Mute | |------| |------| | |
|
* | | |------| |------| | |
|
||||||
* | | | | | Prev | | |
|
* | | | | | | | |
|
||||||
* `--------------------' `--------------------'
|
* `--------------------' `--------------------'
|
||||||
*/
|
*/
|
||||||
// SYMBOLS
|
// SYMBOLS
|
||||||
[SYMB] = KEYMAP(
|
[NMBR] = KEYMAP(
|
||||||
// left hand
|
// left hand
|
||||||
KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_INS,
|
KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
|
||||||
KC_TRNS,KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_VOLU,
|
KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS,
|
||||||
KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
KC_TRNS,KC_TRNS,LSFT(KC_DELT),LCTL(KC_INS),LSFT(KC_INS),KC_MUTE,KC_VOLD,
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
|
||||||
KC_TRNS,KC_TRNS,
|
KC_TRNS,KC_TRNS,
|
||||||
KC_TRNS,
|
KC_TRNS,
|
||||||
KC_MUTE, KC_TRNS,KC_TRNS,
|
KC_TRNS, KC_TRNS,KC_TRNS,
|
||||||
// right hand
|
// right hand
|
||||||
KC_INS, KC_F6, KC_F7, KC_TAB, KC_PSLS, KC_PAST, KC_PMNS,
|
KC_INS, KC_F6, KC_F7, KC_TAB, KC_PSLS, KC_PAST, KC_PMNS,
|
||||||
KC_TRNS, KC_TRNS, KC_HOME, KC_P7, KC_P8, KC_P9, KC_PPLS,
|
KC_TRNS, KC_TRNS, KC_HOME, KC_P7, KC_P8, KC_P9, KC_PPLS,
|
||||||
@ -116,54 +117,55 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
KC_TRNS, KC_P0, M(1), KC_PDOT, CTL_T(KC_PENT),
|
KC_TRNS, KC_P0, M(1), KC_PDOT, CTL_T(KC_PENT),
|
||||||
|
|
||||||
KC_NLCK, KC_CAPS,
|
KC_NLCK, KC_CAPS,
|
||||||
KC_MPRV,
|
KC_TRNS,
|
||||||
KC_MNXT, KC_TRNS, KC_TRNS
|
KC_TRNS, KC_TRNS, KC_TRNS
|
||||||
),
|
),
|
||||||
/* Keymap 2: Media and mouse keys
|
/* Keymap 2: fn layer
|
||||||
*
|
*
|
||||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||||
* | | | | | | | | | | | | | | | |
|
* | | | | | | |Insert| |Insert| | | | | | |
|
||||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||||
* | | | | MsUp | | | | | | | | | | | |
|
* | | | | | | |VolUp | | | | | | | | |
|
||||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||||
* | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play |
|
* | | | | | | |------| |------| | | | | | |
|
||||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||||
* | | | | | | | | | | | | Prev | Next | | |
|
* | | | cut | copy |paste | Mute |VolDn | | | | | | | | |
|
||||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||||
* | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | |
|
* | | | | | | | | | | | |
|
||||||
* `----------------------------------' `----------------------------------'
|
* `----------------------------------' `----------------------------------'
|
||||||
* ,-------------. ,-------------.
|
* ,-------------. ,-------------.
|
||||||
* | | | | | |
|
* | | | | | |
|
||||||
* ,------|------|------| |------+------+------.
|
* ,------|------|------| |------+------+------.
|
||||||
* | | | | | | |Brwser|
|
* | | | | | Next | | |
|
||||||
* | | |------| |------| |Back |
|
* | Mute | |------| |------| | |
|
||||||
* | | | | | | | |
|
* | | | | | Prev | | |
|
||||||
* `--------------------' `--------------------'
|
* `--------------------' `--------------------'
|
||||||
*/
|
*/
|
||||||
// MEDIA AND MOUSE
|
// MEDIA AND MOUSE
|
||||||
KEYMAP(
|
[FNLR] = KEYMAP(
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS,
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS,
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU,
|
||||||
KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
KC_TRNS, KC_TRNS, LSFT(KC_DELT),LCTL(KC_INS),LSFT(KC_INS), KC_MUTE, KC_VOLD,
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2,
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
|
||||||
KC_TRNS, KC_TRNS,
|
KC_TRNS, KC_TRNS,
|
||||||
KC_TRNS,
|
KC_TRNS,
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS,
|
KC_MUTE, KC_TRNS, KC_TRNS,
|
||||||
// right hand
|
// right hand
|
||||||
|
KC_INS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY,
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS,
|
|
||||||
KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS,
|
|
||||||
KC_TRNS, KC_TRNS,
|
KC_TRNS, KC_TRNS,
|
||||||
KC_TRNS,
|
KC_MPRV,
|
||||||
KC_TRNS, KC_TRNS, KC_WBAK
|
KC_MNXT, KC_TRNS, KC_TRNS
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
const uint16_t PROGMEM fn_actions[] = {
|
const uint16_t PROGMEM fn_actions[] = {
|
||||||
[1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||||
@ -182,6 +184,9 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
|||||||
return MACRO( I(25), T(P0), T(P0), END );
|
return MACRO( I(25), T(P0), T(P0), END );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 2:
|
||||||
|
layer_state ^= (1 << NMBR) | (1 << FNLR);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return MACRO_NONE;
|
return MACRO_NONE;
|
||||||
};
|
};
|
||||||
@ -194,24 +199,19 @@ void * matrix_init_user(void) {
|
|||||||
// Runs constantly in the background, in a loop.
|
// Runs constantly in the background, in a loop.
|
||||||
void * matrix_scan_user(void) {
|
void * matrix_scan_user(void) {
|
||||||
|
|
||||||
uint8_t layer = biton32(layer_state);
|
|
||||||
|
|
||||||
ergodox_board_led_off();
|
ergodox_board_led_off();
|
||||||
ergodox_right_led_1_off();
|
ergodox_right_led_1_off();
|
||||||
ergodox_right_led_2_off();
|
ergodox_right_led_2_off();
|
||||||
ergodox_right_led_3_off();
|
ergodox_right_led_3_off();
|
||||||
switch (layer) {
|
// led 1: numbers layer
|
||||||
// TODO: Make this relevant to the ErgoDox EZ.
|
if (layer_state & (1 << NMBR)) {
|
||||||
case 1:
|
|
||||||
ergodox_right_led_1_on();
|
ergodox_right_led_1_on();
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
ergodox_right_led_2_on();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
// none
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
// led 2: fn layer
|
||||||
|
if (layer_state & (1 << FNLR)) {
|
||||||
|
ergodox_right_led_2_on();
|
||||||
|
}
|
||||||
|
// led 3: caps lock
|
||||||
if (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) {
|
if (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) {
|
||||||
ergodox_right_led_3_on();
|
ergodox_right_led_3_on();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user