You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.4 KiB

  1. #include QMK_KEYBOARD_H
  2. // Tap Dance Declarations
  3. enum tap_dances {
  4. ENT_5 = 0,
  5. ZERO_7,
  6. };
  7. // Macro Declarations
  8. enum custom_keycodes {
  9. DBL_0 = SAFE_RANGE,
  10. };
  11. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  12. /* LAYER 0
  13. * ,-----------------------.
  14. * | 1 | 2 | 3 |
  15. * |-------+-------+-------|
  16. * | 4 | 5/ENT | 6 | Dbl Tap 5 for Enter
  17. * |-------+-------+-------|
  18. * | 7/0 | 8 | 9/FN | 7/0 = Dbl Tap 7 for 0 - 9/FN = Hold 9 for FN
  19. * `-----------------------'
  20. */
  21. [0] = LAYOUT( \
  22. KC_1, KC_2, KC_3, \
  23. KC_4, TD(ENT_5), KC_6, \
  24. TD(ZERO_7), KC_8, LT(1, KC_9) \
  25. ),
  26. /* LAYER 1
  27. * ,-----------------------.
  28. * | ESC | + | - |
  29. * |-------+-------+-------|
  30. * | BSPC | * | / |
  31. * |-------+-------+-------|
  32. * | 00 | . | |
  33. * `-----------------------'
  34. */
  35. [1] = LAYOUT( \
  36. KC_ESC, KC_PLUS, KC_MINS, \
  37. KC_BSPC, KC_ASTR, KC_SLSH, \
  38. DBL_0, KC_DOT, KC_TRNS \
  39. )
  40. };
  41. qk_tap_dance_action_t tap_dance_actions[] = {
  42. [ENT_5] = ACTION_TAP_DANCE_DOUBLE(KC_5, KC_ENT),
  43. [ZERO_7] = ACTION_TAP_DANCE_DOUBLE(KC_7, KC_0)
  44. };
  45. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  46. switch (keycode) {
  47. case DBL_0:
  48. if (record->event.pressed) {
  49. // when keycode QMKBEST is pressed
  50. tap_code(KC_P0);
  51. tap_code(KC_P0);
  52. }
  53. break;
  54. }
  55. return true;
  56. };
  57. void matrix_init_user(void) {
  58. }