From 0314620d26b7759ff08aac3a9709262814352b55 Mon Sep 17 00:00:00 2001 From: "Anand Babu (AB) Periasamy" Date: Fri, 24 Jun 2016 10:43:12 -0700 Subject: Swap up and down on ab's layout to match default (#441) --- keyboards/planck/keymaps/ab/keyboard-layout.json | 156 +++++++++++++++++------ keyboards/planck/keymaps/ab/keyboard-layout.png | Bin 26123 -> 25545 bytes keyboards/planck/keymaps/ab/keymap.c | 31 ++--- 3 files changed, 133 insertions(+), 54 deletions(-) (limited to 'keyboards/planck/keymaps') diff --git a/keyboards/planck/keymaps/ab/keyboard-layout.json b/keyboards/planck/keymaps/ab/keyboard-layout.json index 6e33ec6bfd..72dab2a7f8 100644 --- a/keyboards/planck/keymaps/ab/keyboard-layout.json +++ b/keyboards/planck/keymaps/ab/keyboard-layout.json @@ -4,60 +4,118 @@ "author": "Anand Babu Periasamy" }, [ - "1\nF1\n!\n\n\n\n\n\n\nTab", - "2\nF2\n@\n\n\n\n\n\n\nQ", - "3\nF3\n#\n\n\n\n\n\n\nW", - "4\nF4\n$\n\n\n\n\n\n\nE", - "5\nF5\n%\n\n\n\n\n\n\nR", - "6\nF6\n^\n\n\n\n\n\n\nT", - "7\nF7\n&\n\n\n\n\n\n\nY", - "8\nF8\n*\n\n\n\n\n\n\nU", - "9\nF9\n(\n\n\n\n\n\n\nI", - "0\nF10\n)\n\n\n\n\n\n\nO", - "-\nF11\n_\n\n\n\n\n\n\nP", - "=\nF12\n+\n\n\n\n\n\n\n" + { + "fa": [ + 2, + 2, + 0, + 2 + ] + }, + "F1\n1\n\n!\n\n\n\n\n\nTab", + "F2\n2\n\n@\n\n\n\n\n\nQ", + "F3\n3\n\n#\n\n\n\n\n\nW", + "F4\n4\n\n$\n\n\n\n\n\nE", + "F5\n5\n\n%\n\n\n\n\n\nR", + "F6\n6\n\n^\n\n\n\n\n\nT", + "F7\n7\n\n&\n\n\n\n\n\nY", + "F8\n8\n\n*\n\n\n\n\n\nU", + "F9\n9\n\n(\n\n\n\n\n\nI", + "F10\n0\n\n)\n\n\n\n\n\nO", + "F11\n-\n\n_\n\n\n\n\n\nP", + "F12\n=\n\n+\n\n\n\n\n\n" ], [ { - "a": 7 + "a": 7, + "f": 3 }, "Ctrl", + { + "f": 3 + }, "A", + { + "f": 3 + }, "S", + { + "f": 3 + }, "D", { - "a": 4 + "a": 4, + "f": 3 + }, + "\n(\n\n\n\n\n\n\n\nF", + { + "f": 3 }, - "(\n\n\n\n\n\n\n\n\nF", - ")\n\n\n\n\n\n\n\n\nG", - "{\n\n\n\n\n\n\n\n\nH", - "}\n\n\n\n\n\n\n\n\nJ", + "\n)\n\n\n\n\n\n\n\nG", { - "a": 7 + "f": 3 + }, + "\n{\n\n\n\n\n\n\n\nH", + { + "f": 3 + }, + "\n}\n\n\n\n\n\n\n\nJ", + { + "a": 7, + "f": 3 }, "K", + { + "f": 3 + }, "L", { - "a": 6 + "a": 6, + "f": 3 }, ";\n\n:", { - "a": 7 + "a": 7, + "f": 3 }, "Enter" ], [ + { + "f": 3 + }, "Shift", + { + "f": 3 + }, "Z", + { + "f": 3 + }, "X", + { + "f": 3 + }, "C", { - "a": 4 + "a": 4, + "fa": [ + 0, + 2, + 0, + 2, + 0, + 0, + 0, + 0, + 0, + 2 + ] }, - "[\n`\n\n\n\n\n\n\n\nV", - "]\n~\n\n\n\n\n\n\n\nB", - "'\n\\\n\n\n\n\n\n\n\nN", - "\"\n|\n\n\n\n\n\n\n\nM", + "\\\n[\n\n\n\n\n\n\n\nV", + "|\n]\n\n\n\n\n\n\n\nB", + "`\n'\n\n\n\n\n\n\n\nN", + "~\n\"\n\n\n\n\n\n\n\nM", { "a": 6 }, @@ -71,31 +129,57 @@ ], [ { - "a": 4 + "a": 4, + "fa": [ + 2, + 2 + ] }, - "\n\n\n\n\n\n\n\n\nCtrl", + "\n\n\n\n\n\n\n\n\nCtrl", { - "a": 7 + "a": 7, + "f": 3 }, "Esc", + { + "f": 3 + }, "", + { + "f": 3 + }, "Alt", - "", + { + "f": 3 + }, + "", { "a": 4, + "f": 3, "w": 2 }, - "\nPgUP\n\nPgDn\n\n\n\n\n\nSpace", + "PgUp\nPgDn\n\n\n\n\n\n\n\nSpace", { - "a": 7 + "a": 7, + "f": 3 + }, + "", + { + "f": 3 }, - "", "", { - "a": 4 + "a": 4, + "f": 3 + }, + "\n\n\n\n\n\n\n\n\n", + { + "f": 3 + }, + "\n\n\n\n\n\n\n\n\n", + { + "f": 3 }, - "\n\n\n\n\n\n\n\n\n", - "\n\n\n\n\n\n\n\n\n", "\n\n\n\n\n\n\n\n\n" ] ] \ No newline at end of file diff --git a/keyboards/planck/keymaps/ab/keyboard-layout.png b/keyboards/planck/keymaps/ab/keyboard-layout.png index 64bf0aa1c2..e4c0e91b40 100644 Binary files a/keyboards/planck/keymaps/ab/keyboard-layout.png and b/keyboards/planck/keymaps/ab/keyboard-layout.png differ diff --git a/keyboards/planck/keymaps/ab/keymap.c b/keyboards/planck/keymaps/ab/keymap.c index 57f90ab576..c70e253fb2 100644 --- a/keyboards/planck/keymaps/ab/keymap.c +++ b/keyboards/planck/keymaps/ab/keymap.c @@ -12,8 +12,8 @@ extern keymap_config_t keymap_config; // Symbolic names for macro IDs. #define _QWERTY 0 // QUERTY layer -#define _RAISE 1 // Raise layer -#define _LOWER 2 // Lower layer +#define _LOWER 1 // Lower layer +#define _RAISE 2 // Raise layer #define _CUSTOM 3 // Custom layer #define _BL 4 // Backlight #define _MOBILE 5 // Mobile# @@ -21,8 +21,8 @@ extern keymap_config_t keymap_config; #define _CUSTOM2 7 // Custom macro 2 // Macro shortcuts. -#define RAISE M(_RAISE) #define LOWER M(_LOWER) +#define RAISE M(_RAISE) #define CUSTOM M(_CUSTOM) // RAISE + LOWER #define BL M(_BL) #define MOBILE M(_MOBILE) @@ -35,19 +35,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {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_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, FUNC(3)}, - {KC_LCTL, KC_ESC, KC_LGUI, KC_LALT, RAISE, KC_SPC, KC_SPC, LOWER, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT} + {KC_LCTL, KC_ESC, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, -[_RAISE] = { /* RAISE */ +[_LOWER] = { /* LOWER */ {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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LPRN, KC_RPRN, KC_LCBR, KC_RCBR, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_QUOT, KC_DQT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, - {BL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} + {BL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} }, -[_LOWER] = { /* LOWER */ +[_RAISE] = { /* RAISE */ {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}, {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LCBR, KC_LCBR, KC_BSLS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_GRV, KC_TILD, KC_BSLS, KC_PIPE, KC_LBRC, KC_LBRC, KC_TRNS, KC_TRNS}, - {RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_PGDN, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE} + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, KC_PIPE, KC_GRV, KC_TILD, KC_LBRC, KC_LBRC, KC_TRNS, KC_TRNS}, + {RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_PGUP, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE} }, [_CUSTOM] = { /* CUSTOM */ {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, @@ -57,11 +57,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { } }; -// Enable these functions using FUNC(n) macro. They seem to be buggy mostly. +// Enable these functions using FUNC(n) macro. const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_TAP_KEY(_RAISE, KC_PGUP), // Tap for PgUp, hold for RAISE - [1] = ACTION_LAYER_TAP_KEY(_LOWER, KC_PGDN), // Tap for PgDn, hold for LOWER - [2] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_CAPS), // Tap for Caps, hold for Ctrl + [0] = ACTION_LAYER_TAP_KEY(_LOWER, KC_PGDN), // Tap for PgDn, hold for LOWER + [1] = ACTION_LAYER_TAP_KEY(_RAISE, KC_PGUP), // Tap for PgUp, hold for RAISE + [2] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_CAPS), // Tap for Caps, hold for Ctrl (DOESN'T SEEM TO WORK) [3] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), // Tap for Enter, hold for Shift }; @@ -75,11 +75,6 @@ void persistant_default_layer_set(uint16_t default_layer) { const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { switch(id) { - case _QWERTY: // Default QWERTY layer. // This case not used for now. - if (record->event.pressed) { - persistant_default_layer_set(1UL<<_QWERTY); - } - break; case _RAISE: // Raised layer. if (record->event.pressed) { layer_on(_RAISE); -- cgit v1.2.3 From 00dcac7270aabeb2f473315e94d298b4766df88c Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sun, 26 Jun 2016 14:08:11 -0400 Subject: updates planck macros to keycodes, prototype fn_actions --- keyboards/planck/keymaps/default/keymap.c | 58 ++++++++++++++----------------- 1 file changed, 27 insertions(+), 31 deletions(-) (limited to 'keyboards/planck/keymaps') diff --git a/keyboards/planck/keymaps/default/keymap.c b/keyboards/planck/keymaps/default/keymap.c index 4bca1b5ac0..6bc6f78e56 100644 --- a/keyboards/planck/keymaps/default/keymap.c +++ b/keyboards/planck/keymaps/default/keymap.c @@ -22,16 +22,17 @@ extern keymap_config_t keymap_config; #define _PLOVER 5 #define _ADJUST 16 -// Macro name shortcuts -#define QWERTY M(_QWERTY) -#define COLEMAK M(_COLEMAK) -#define DVORAK M(_DVORAK) -#define LOWER M(_LOWER) -#define RAISE M(_RAISE) -#define M_BL 5 -#define PLOVER M(12) -#define EXT_PLV M(13) -#define TOG_OUT M(14) +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV, + TOG_OUT +}; // Fillers to make layering more clear #define _______ KC_TRNS @@ -54,7 +55,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {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 }, - {M(M_BL), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, /* Colemak @@ -72,7 +73,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {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 }, - {M(M_BL), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, /* Dvorak @@ -90,7 +91,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {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 }, - {M(M_BL), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, /* Lower @@ -167,10 +168,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { } -}; - -const uint16_t PROGMEM fn_actions[] = { - }; #ifdef AUDIO_ENABLE @@ -192,10 +189,9 @@ void persistant_default_layer_set(uint16_t default_layer) { default_layer_set(default_layer); } -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case _QWERTY: +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); @@ -203,7 +199,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) persistant_default_layer_set(1UL<<_QWERTY); } break; - case _COLEMAK: + case COLEMAK: if (record->event.pressed) { #ifdef AUDIO_ENABLE PLAY_NOTE_ARRAY(tone_colemak, false, 0); @@ -211,7 +207,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) persistant_default_layer_set(1UL<<_COLEMAK); } break; - case _DVORAK: + case DVORAK: if (record->event.pressed) { #ifdef AUDIO_ENABLE PLAY_NOTE_ARRAY(tone_dvorak, false, 0); @@ -219,7 +215,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) persistant_default_layer_set(1UL<<_DVORAK); } break; - case _LOWER: + case LOWER: if (record->event.pressed) { layer_on(_LOWER); update_tri_layer(_LOWER, _RAISE, _ADJUST); @@ -228,7 +224,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) update_tri_layer(_LOWER, _RAISE, _ADJUST); } break; - case _RAISE: + case RAISE: if (record->event.pressed) { layer_on(_RAISE); update_tri_layer(_LOWER, _RAISE, _ADJUST); @@ -237,7 +233,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) update_tri_layer(_LOWER, _RAISE, _ADJUST); } break; - case M_BL: + case BACKLIT: if (record->event.pressed) { register_code(KC_RSFT); #ifdef BACKLIGHT_ENABLE @@ -247,7 +243,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) unregister_code(KC_RSFT); } break; - case 12: + case PLOVER: if (record->event.pressed) { #ifdef AUDIO_ENABLE stop_all_notes(); @@ -265,7 +261,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) eeconfig_update_keymap(keymap_config.raw); } break; - case 13: + case EXT_PLV: if (record->event.pressed) { #ifdef AUDIO_ENABLE PLAY_NOTE_ARRAY(tone_plover_gb, false, 0); @@ -273,14 +269,14 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) layer_off(_PLOVER); } break; - case 14: + case TOG_OUT: if (record->event.pressed) { return MACRO( D(E), D(R), D(F), D(V), D(O), D(L), U(E), U(R), U(F), U(V), U(O), U(L), END ); } break; } - return MACRO_NONE; -}; + return true; +} void matrix_init_user(void) { #ifdef AUDIO_ENABLE -- cgit v1.2.3 From 0058c33815c2153ac1efffd4ba2e2bac241b5474 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sun, 26 Jun 2016 14:20:57 -0400 Subject: updates preonic default layout --- keyboards/planck/keymaps/default/keymap.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'keyboards/planck/keymaps') diff --git a/keyboards/planck/keymaps/default/keymap.c b/keyboards/planck/keymaps/default/keymap.c index 6bc6f78e56..9b4b33f821 100644 --- a/keyboards/planck/keymaps/default/keymap.c +++ b/keyboards/planck/keymaps/default/keymap.c @@ -30,8 +30,7 @@ enum planck_keycodes { LOWER, RAISE, BACKLIT, - EXT_PLV, - TOG_OUT + EXT_PLV }; // Fillers to make layering more clear @@ -145,7 +144,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_PLOVER] = { {KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 }, {XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC}, - {TOG_OUT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, {EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX} }, @@ -199,6 +198,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { persistant_default_layer_set(1UL<<_QWERTY); } break; + return false; case COLEMAK: if (record->event.pressed) { #ifdef AUDIO_ENABLE @@ -207,6 +207,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { persistant_default_layer_set(1UL<<_COLEMAK); } break; + return false; case DVORAK: if (record->event.pressed) { #ifdef AUDIO_ENABLE @@ -215,6 +216,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { persistant_default_layer_set(1UL<<_DVORAK); } break; + return false; case LOWER: if (record->event.pressed) { layer_on(_LOWER); @@ -224,6 +226,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { update_tri_layer(_LOWER, _RAISE, _ADJUST); } break; + return false; case RAISE: if (record->event.pressed) { layer_on(_RAISE); @@ -233,6 +236,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { update_tri_layer(_LOWER, _RAISE, _ADJUST); } break; + return false; case BACKLIT: if (record->event.pressed) { register_code(KC_RSFT); @@ -242,7 +246,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } else { unregister_code(KC_RSFT); } - break; + break; + return false; case PLOVER: if (record->event.pressed) { #ifdef AUDIO_ENABLE @@ -260,7 +265,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { keymap_config.nkro = 1; eeconfig_update_keymap(keymap_config.raw); } - break; + break; + return false; case EXT_PLV: if (record->event.pressed) { #ifdef AUDIO_ENABLE @@ -268,12 +274,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #endif layer_off(_PLOVER); } - break; - case TOG_OUT: - if (record->event.pressed) { - return MACRO( D(E), D(R), D(F), D(V), D(O), D(L), U(E), U(R), U(F), U(V), U(O), U(L), END ); - } - break; + break; + return false; } return true; } -- cgit v1.2.3 From 57066b12464a7d1d7f12dec573f4691587d559a6 Mon Sep 17 00:00:00 2001 From: "Anand Babu (AB) Periasamy" Date: Mon, 27 Jun 2016 06:51:12 -0700 Subject: zoom and undo keys for ab's planck keymap (#446) --- keyboards/planck/keymaps/ab/keyboard-layout.json | 38 +++++++------- keyboards/planck/keymaps/ab/keyboard-layout.png | Bin 25545 -> 26518 bytes keyboards/planck/keymaps/ab/keymap.c | 63 ++++++++++++++--------- 3 files changed, 58 insertions(+), 43 deletions(-) (limited to 'keyboards/planck/keymaps') diff --git a/keyboards/planck/keymaps/ab/keyboard-layout.json b/keyboards/planck/keymaps/ab/keyboard-layout.json index 72dab2a7f8..4e631a3487 100644 --- a/keyboards/planck/keymaps/ab/keyboard-layout.json +++ b/keyboards/planck/keymaps/ab/keyboard-layout.json @@ -44,11 +44,13 @@ }, "D", { + "c": "#c4bcbc", "a": 4, "f": 3 }, "\n(\n\n\n\n\n\n\n\nF", { + "c": "#cccccc", "f": 3 }, "\n)\n\n\n\n\n\n\n\nG", @@ -57,10 +59,12 @@ }, "\n{\n\n\n\n\n\n\n\nH", { + "c": "#c4bcbc", "f": 3 }, "\n}\n\n\n\n\n\n\n\nJ", { + "c": "#cccccc", "a": 7, "f": 3 }, @@ -136,26 +140,20 @@ ] }, "\n\n\n\n\n\n\n\n\nCtrl", + "\n\n\n\n\n\n\n\n\nEsc", + "\n\n\n\n\n\n\n\n\n", + "\n\n\n\n\n\n\n\n\nAlt", { "a": 7, "f": 3 }, - "Esc", - { - "f": 3 - }, - "", - { - "f": 3 - }, - "Alt", - { - "f": 3 - }, "", { "a": 4, - "f": 3, + "fa": [ + 1, + 1 + ], "w": 2 }, "PgUp\nPgDn\n\n\n\n\n\n\n\nSpace", @@ -165,21 +163,23 @@ }, "", { - "f": 3 + "a": 4, + "fa": [ + 2 + ] }, - "", + "\n\n\n\n\n\n\n\n\n", { - "a": 4, "f": 3 }, - "\n\n\n\n\n\n\n\n\n", + "\n\n\n\n\n\n\n\n\n", { "f": 3 }, - "\n\n\n\n\n\n\n\n\n", + "\n\n\n\n\n\n\n\n\n", { "f": 3 }, - "\n\n\n\n\n\n\n\n\n" + "\n\n\n\n\n\n\n\n\n" ] ] \ No newline at end of file diff --git a/keyboards/planck/keymaps/ab/keyboard-layout.png b/keyboards/planck/keymaps/ab/keyboard-layout.png index e4c0e91b40..dcdbb726df 100644 Binary files a/keyboards/planck/keymaps/ab/keyboard-layout.png and b/keyboards/planck/keymaps/ab/keyboard-layout.png differ diff --git a/keyboards/planck/keymaps/ab/keymap.c b/keyboards/planck/keymaps/ab/keymap.c index c70e253fb2..8e1d28a65a 100644 --- a/keyboards/planck/keymaps/ab/keymap.c +++ b/keyboards/planck/keymaps/ab/keymap.c @@ -14,57 +14,72 @@ extern keymap_config_t keymap_config; #define _QWERTY 0 // QUERTY layer #define _LOWER 1 // Lower layer #define _RAISE 2 // Raise layer -#define _CUSTOM 3 // Custom layer +#define _CUSTOM 3 // Custom layer (LOWER + RAISE) #define _BL 4 // Backlight -#define _MOBILE 5 // Mobile# -#define _CUSTOM1 6 // Custom macro 1 -#define _CUSTOM2 7 // Custom macro 2 +#define _MOB 5 // Mobile# +#define _CUS1 6 // Custom macro 1 +#define _CUS2 7 // Custom macro 2 // Macro shortcuts. +#define QWERTY M(_LOWER) #define LOWER M(_LOWER) #define RAISE M(_RAISE) -#define CUSTOM M(_CUSTOM) // RAISE + LOWER +#define CUSTOM M(_CUSTOM) #define BL M(_BL) -#define MOBILE M(_MOBILE) -#define CUSTOM1 M(_CUSTOM1) -#define CUSTOM2 M(_CUSTOM2) +#define MOB M(_MOB) +#define CUS1 M(_CUS1) +#define CUS2 M(_CUS2) + +// Func macro definitions. +#define LWR_PGDN FUNC(0) // Tap for PgDn, hold for LOWER +#define RSE_PGUP FUNC(1) // Tap for PgUp, hold for RAISE +#define CTL_CAPS FUNC(2) // Tap for Caps, hold for Ctrl (DOESN'T SEEM TO WORK) +#define SFT_ENT FUNC(3) // Tap for Enter, hold for Shift +#define ZM_NRM FUNC(4) // Zoom normal +#define ZM_IN FUNC(5) // Zoom out +#define ZM_OUT FUNC(6) // Zoom in +#define EM_UNDO FUNC(7) // Emacs Undo + +// Enable these functions using FUNC(n) macro. +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_TAP_KEY(_LOWER, KC_PGDN), + [1] = ACTION_LAYER_TAP_KEY(_RAISE, KC_PGUP), + [2] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_CAPS), + [3] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), + [4] = ACTION_MODS_KEY(MOD_LCTL, KC_0), + [5] = ACTION_MODS_KEY(MOD_LCTL, KC_MINS), + [6] = ACTION_MODS_KEY(MOD_LCTL, KC_PLUS), + [7] = ACTION_MODS_KEY(MOD_LCTL, KC_UNDS), + }; // This config can be found at Keyboard layout editor site: http://goo.gl/zjXL2l const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = { /* QWERTY */ {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_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, FUNC(3)}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT}, {KC_LCTL, KC_ESC, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, [_LOWER] = { /* LOWER */ {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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LPRN, KC_RPRN, KC_LCBR, KC_RCBR, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_QUOT, KC_DQT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, - {BL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} + {BL, ZM_NRM, ZM_IN, ZM_OUT, KC_TRNS, KC_PGDN, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} }, [_RAISE] = { /* RAISE */ {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}, {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LCBR, KC_LCBR, KC_BSLS, KC_TRNS}, {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, KC_PIPE, KC_GRV, KC_TILD, KC_LBRC, KC_LBRC, KC_TRNS, KC_TRNS}, - {RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_PGUP, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE} + {RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_PGUP, KC_TRNS, EM_UNDO, KC_VOLD, KC_VOLU, KC_MUTE} }, [_CUSTOM] = { /* CUSTOM */ {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, MOBILE, KC_TRNS, CUSTOM1, CUSTOM2, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MOB, KC_TRNS, CUS1, CUS2, 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} } }; -// Enable these functions using FUNC(n) macro. -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_TAP_KEY(_LOWER, KC_PGDN), // Tap for PgDn, hold for LOWER - [1] = ACTION_LAYER_TAP_KEY(_RAISE, KC_PGUP), // Tap for PgUp, hold for RAISE - [2] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_CAPS), // Tap for Caps, hold for Ctrl (DOESN'T SEEM TO WORK) - [3] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), // Tap for Enter, hold for Shift -}; - // Set a layer persistantly. void persistant_default_layer_set(uint16_t default_layer) { eeconfig_update_default_layer(default_layer); @@ -93,7 +108,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) update_tri_layer(_LOWER, _RAISE, _CUSTOM); } break; - case _BL:// Backlight + case _BL: // Backlight if (record->event.pressed) { register_code(KC_RSFT); #ifdef BACKLIGHT_ENABLE @@ -103,14 +118,14 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) unregister_code(KC_RSFT); } break; - case _MOBILE:// Your mobile# here. + case _MOB: // Your mobile# here. return MACRODOWN(T(1), T(2), T(3), T(MINS), T(1), T(2), T(3), T(MINS), T(1), T(2), T(3), T(4), END); - case _CUSTOM1:// Your custom macro 1 + case _CUS1: // Your custom macro 1 return MACRODOWN(T(E), T(M), T(A), T(C), T(S), T(SPC), END); - case _CUSTOM2:// Your custom macro 2 + case _CUS2: // Your custom macro 2 return MACRODOWN(T(L), T(S), T(SPC), T(MINS), T(L), T(ENT), END); }; return MACRO_NONE; -- cgit v1.2.3