diff options
author | Cory Shaw <cory.shaw.dev@gmail.com> | 2017-08-24 21:15:58 -0400 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2017-08-24 21:29:10 -0400 |
commit | 2aedbf872b0c8dcc1de71d0976b026cf1e1c0448 (patch) | |
tree | 5650b449919f245ee1c3d66ca45ad25b4511391c | |
parent | afd7bf5f096efb141c888fb0efc3d23e166a00ae (diff) | |
download | qmk_firmware-2aedbf872b0c8dcc1de71d0976b026cf1e1c0448.tar.gz qmk_firmware-2aedbf872b0c8dcc1de71d0976b026cf1e1c0448.zip |
Improve default layout of 9key and give example macro
-rw-r--r-- | keyboards/9key/keymaps/default/keymap.c | 62 |
1 files changed, 40 insertions, 22 deletions
diff --git a/keyboards/9key/keymaps/default/keymap.c b/keyboards/9key/keymaps/default/keymap.c index 23364e8537..65f0cdd208 100644 --- a/keyboards/9key/keymaps/default/keymap.c +++ b/keyboards/9key/keymaps/default/keymap.c @@ -2,45 +2,63 @@ // Tap Dance Declarations enum { - ENT_5 = 0 + ENT_5 = 0, + ZERO_7 +}; + +// Macro Declarations +enum { + DBL_0 = 0 }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* LAYER 0 - * ,-----------------. - * | 1 | 2 | 3 | - * |-----+-----+-----| - * | 4 |5/ENT| 6 | Dbl Tap 5 for Enter - * |-----+-----+-----| - * | 7 | 8 | FN | - * `-----------------' + * ,-----------------------. + * | 1 | 2 | 3 | + * |-------+-------+-------| + * | 4 | 5/ENT | 6 | Dbl Tap 5 for Enter + * |-------+-------+-------| + * | 7/0 | 8 | 9/FN | 7/0 = Dbl Tap 7 for 0 - 9/FN = Hold 9 for FN + * `-----------------------' */ [0] = KEYMAP( \ - KC_1, KC_2, KC_3, \ - KC_4, TD(ENT_5), KC_6, \ - KC_7, KC_8, MO(1) \ + KC_1, KC_2, KC_3, \ + KC_4, TD(ENT_5), KC_6, \ + TD(ZERO_7), KC_8, LT(1, KC_9) \ ), /* LAYER 1 - * ,-----------------. - * | 9 | 0 | - | - * |-----+-----+-----| - * | + | * | / | - * |-----+-----+-----| - * | F1 | F2 | | - * `-----------------' + * ,-----------------------. + * | ESC | + | - | + * |-------+-------+-------| + * | BSPC | * | / | + * |-------+-------+-------| + * | 00 | . | | + * `-----------------------' */ [1] = KEYMAP( \ - KC_9, KC_0, KC_MINS, \ - KC_PLUS, KC_ASTR, KC_SLSH, \ - KC_F1, KC_F2, KC_TRNS \ + KC_ESC, KC_PLUS, KC_MINS, \ + KC_BSPC, KC_ASTR, KC_SLSH, \ + M(DBL_0), KC_DOT, KC_TRNS \ ) }; qk_tap_dance_action_t tap_dance_actions[] = { - [ENT_5] = ACTION_TAP_DANCE_DOUBLE(KC_5, KC_ENT) + [ENT_5] = ACTION_TAP_DANCE_DOUBLE(KC_5, KC_ENT), + [ZERO_7] = ACTION_TAP_DANCE_DOUBLE(KC_7, KC_0) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + if (record->event.pressed) { + switch(id) { + case DBL_0: + SEND_STRING("00"); + return false; + } + } + return MACRO_NONE; }; void matrix_init_user(void) { |