logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

keymap.c (2180B)


  1. #include QMK_KEYBOARD_H
  2. /*
  3. * This keymap is based on the default keymap for the cospad.
  4. * It was adapted for the split Plus and split 0 layout focusing on the "00" key.
  5. */
  6. enum custom_keycodes {
  7. DBL_ZRO = SAFE_RANGE,
  8. };
  9. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  10. switch (keycode) {
  11. case DBL_ZRO:
  12. if (record->event.pressed) {
  13. // when keycode DBL_ZRO is pressed
  14. SEND_STRING("00");
  15. } else {
  16. // when keycode DBL_ZRO is released
  17. }
  18. break;
  19. }
  20. return true;
  21. };
  22. // Defines names for use in layer keycodes and the keymap
  23. enum layer_names {
  24. _BL,
  25. _FL
  26. };
  27. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  28. /* Keymap _BL: (Base Layer) Default Layer
  29. * ,-------------------.
  30. * |Esc |TAB | FN | BS |
  31. * |----|----|----|----|
  32. * | NL | / | * | - |
  33. * |----|----|----|----|
  34. * | 7 | 8 | 9 | ~ |
  35. * |----|----|----|----|
  36. * | 4 | 5 | 6 | + |
  37. * |----|----|----|----|
  38. * | 1 | 2 | 3 | |
  39. * |----|----|----| En |
  40. * | 0 | 00 | . | |
  41. * `-------------------'
  42. */
  43. [_BL] = LAYOUT_numpad_6x4_split_plus_zero(
  44. KC_ESC, KC_TAB, MO(_FL), KC_BSPC,
  45. KC_NUM, KC_PSLS, KC_PAST, KC_PMNS,
  46. KC_P7, KC_P8, KC_P9, KC_TILD,
  47. KC_P4, KC_P5, KC_P6, KC_PPLS,
  48. KC_P1, KC_P2, KC_P3,
  49. KC_P0, DBL_ZRO, KC_PDOT, KC_PENT
  50. ),
  51. /* Keymap _FL: Function Layer
  52. * ,-------------------.
  53. * |RGBT| | | |
  54. * |----|----|----|----|
  55. * |RGBM|RGBP|BTOG| |
  56. * |----|----|----|----|
  57. * |HUD |HUI |BON | |
  58. * |----|----|----|----|
  59. * |SAD |SAI |BOFF| |
  60. * |----|----|----|----|
  61. * |VAD |VAS |BSTP| |
  62. * |----|----|----| |
  63. * | | |RST | |
  64. * `-------------------'
  65. */
  66. [_FL] = LAYOUT_numpad_6x4_split_plus_zero(
  67. UG_TOGG, _______, _______, _______,
  68. UG_NEXT, RGB_M_P, BL_TOGG, _______,
  69. UG_HUED, UG_HUEU, BL_ON, _______,
  70. UG_SATD, UG_SATU, BL_OFF, _______,
  71. UG_VALD, UG_VALU, BL_STEP,
  72. _______, _______, QK_BOOT, _______
  73. )
  74. };