diff options
author | Drashna Jaelre <drashna@live.com> | 2019-05-21 13:40:50 -0700 |
---|---|---|
committer | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2019-05-21 13:40:50 -0700 |
commit | eb756916c2b1d3b03b1aa26b8bb02e91ce849089 (patch) | |
tree | f271f762a4cefd915603a4eb67255e8edde20a7a /keyboards/9key/keymaps/tap_dance | |
parent | fc3965ef70ead4d01209c344f9a5f8e1dcf8a1dd (diff) | |
download | qmk_firmware-eb756916c2b1d3b03b1aa26b8bb02e91ce849089.tar.gz qmk_firmware-eb756916c2b1d3b03b1aa26b8bb02e91ce849089.zip |
[Keyboard] Fix 9key macropad keymap (#5942)
Fails to compile on the configurator because tapdance is enabled for the entire keyboard
Diffstat (limited to 'keyboards/9key/keymaps/tap_dance')
-rw-r--r-- | keyboards/9key/keymaps/tap_dance/keymap.c | 69 | ||||
-rw-r--r-- | keyboards/9key/keymaps/tap_dance/rules.mk | 1 |
2 files changed, 70 insertions, 0 deletions
diff --git a/keyboards/9key/keymaps/tap_dance/keymap.c b/keyboards/9key/keymaps/tap_dance/keymap.c new file mode 100644 index 0000000000..a96880aa52 --- /dev/null +++ b/keyboards/9key/keymaps/tap_dance/keymap.c @@ -0,0 +1,69 @@ +#include QMK_KEYBOARD_H + +// Tap Dance Declarations +enum tap_dances { + ENT_5 = 0, + ZERO_7, +}; + +// Macro Declarations +enum custom_keycodes { + DBL_0 = SAFE_RANGE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* LAYER 0 + * ,-----------------------. + * | 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] = LAYOUT( \ + KC_1, KC_2, KC_3, \ + KC_4, TD(ENT_5), KC_6, \ + TD(ZERO_7), KC_8, LT(1, KC_9) \ +), + +/* LAYER 1 + * ,-----------------------. + * | ESC | + | - | + * |-------+-------+-------| + * | BSPC | * | / | + * |-------+-------+-------| + * | 00 | . | | + * `-----------------------' + */ +[1] = LAYOUT( \ + KC_ESC, KC_PLUS, KC_MINS, \ + KC_BSPC, KC_ASTR, KC_SLSH, \ + DBL_0, KC_DOT, KC_TRNS \ +) + +}; + +qk_tap_dance_action_t tap_dance_actions[] = { + [ENT_5] = ACTION_TAP_DANCE_DOUBLE(KC_5, KC_ENT), + [ZERO_7] = ACTION_TAP_DANCE_DOUBLE(KC_7, KC_0) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case DBL_0: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + tap_code(KC_P0); + tap_code(KC_P0); + } + break; + + } + return true; +}; + + +void matrix_init_user(void) { +} diff --git a/keyboards/9key/keymaps/tap_dance/rules.mk b/keyboards/9key/keymaps/tap_dance/rules.mk new file mode 100644 index 0000000000..e5ddcae8d9 --- /dev/null +++ b/keyboards/9key/keymaps/tap_dance/rules.mk @@ -0,0 +1 @@ +TAP_DANCE_ENABLE = yes |