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.

124 lines
5.7 KiB

Update personal layouts, free up matrix_scan_user for JJ40 (#2319) * Add NIU Mini keymap from Planck keymap * Remove old keymap files * Fix README, removed Planck references * Add default layout, move Planck layout to separate folder * Update README * Add my XD60 keymap * Change RShift to slash * Fix keymap: stuck on MO(1) * Move RESET to Fn+Enter * Add: RGB saturation cycle * Add numpad layer to keymap * Fix last case * Cleanup Mechmini keymap. Once the custom RGB function is defined, there is no need to manually handle RGB code. * Change default to KEYMAP_MIT, not KEYMAP_OFFSET * Add custom RGB code for JJ40 * Reset Mechmini advertised power draw to 500. Will have to test actual maximum power draw later. * RGB working on JJ40. * Fix: saturation increase/decrease flipped * Add new directory for my custom keymap with RGB keycodes * Swap LAlt and LGUI * Update JJ40 max power draw with measured value * Update: fun40 rules.mk to enable underglow; earlier failed Travis CI * Fix: init RGB LEDs on boot. Also added HHKB-like keymap for XD60. * Super rudimentary backlight test, init RGB LEDs on boot * Backlighting works - stays on for now * Toggling working * Now can override backlight.c functions. Problem was functions in backlight.c weren't called before due to a lack of matrix_scan_quantum() in matrix.c * Timers not working * Delete global.h * Cleanup * Compiles * Good sign: LEDs stop working again * Handle timer1 overflow * Progress: fix: forgot to init * Backlighting fully working now except breathing. * Revert keymap to original keycodes * Update XD60 keymap README * Update JJ40 keymap with backlight toggles * Breathing working just fine. * Update references * Add backlight_set() call * Cleanup code to disable backlight * Fix: does not compile * Fix: missing call to rgblight_task. * Testing with BACKLIGHT_BREATHING * Cleanup * Cleanup comments * More commenting cleanup. * Do not enable BACKLIGHT_BREATHING by default * Update XD60 keymap * Update: move matrix_scan_kb out from matrix.c to jj40.c (kb-level) * Cleanup for PR * Fix conflict in readme.md for NIU mini * Restore original power consumption figure * Fix: matrix_scan_user() now has to be defined in the keymaps * Add weak `matrix_scan_user` so it does not have to be defined in keymap * Add weak matrix_init_user()
6 years ago
  1. /*
  2. Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #include QMK_KEYBOARD_H
  15. #define _QWERTY 0
  16. #define _LOWER 1
  17. #define _RAISE 2
  18. #define _NAV 3
  19. #define NAV_TAP LT(_NAV, KC_SPC)
  20. enum custom_keycodes {
  21. QWERTY = SAFE_RANGE,
  22. LOWER,
  23. RAISE,
  24. CC_ARRW,
  25. CC_PRN,
  26. CC_BRC,
  27. CC_CBR,
  28. };
  29. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  30. /* Qwerty
  31. * ,-----------------------------------------------------------------------------------.
  32. * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp |
  33. * |------+------+------+------+------+-------------+------+------+------+------+------|
  34. * | Tab | A | S | D | F | G | H | J | K | L | ; |Enter |
  35. * |------+------+------+------+------+------|------+------+------+------+------+------|
  36. * | ` | Z | X | C | V | B | N | M | , | . | / | ' |
  37. * |------+------+------+------+------+------+------+------+------+------+------+------|
  38. * | Ctrl | OS | Alt |Lower |Shift |Raise | Space | Left | Down | Up |Right |
  39. * `-----------------------------------------------------------------------------------'
  40. */
  41. [_QWERTY] = LAYOUT_planck_1x2uR( \
  42. KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
  43. KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \
  44. KC_GRV, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT, \
  45. KC_LCTL, KC_LGUI, KC_LALT, TT(_LOWER), KC_LSFT, TT(_RAISE), NAV_TAP, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
  46. ),
  47. /* Lower
  48. * ,-----------------------------------------------------------------------------------.
  49. * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
  50. * |------+------+------+------+------+-------------+------+------+------+------+------|
  51. * | Ins | | | () | [] | {} | Home | PgDn | PgUp | End | | |
  52. * |------+------+------+------+------+------|------+------+------+------+------+------|
  53. * |QK_BOOT | Back | Fwd | | | | | | Mute | Vol- | Vol+ | |
  54. * |------+------+------+------+------+------+------+------+------+------+------+------|
  55. * | | | | | Lock | | | Prev | Stop | Play | Next |
  56. * `-----------------------------------------------------------------------------------'
  57. */
  58. [_LOWER] = LAYOUT_planck_1x2uR( \
  59. KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \
  60. KC_INS, _______, _______, CC_PRN, CC_BRC, CC_CBR, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, \
  61. QK_BOOT, KC_WBAK, KC_WFWD, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, \
  62. _______, _______, _______, _______, QK_LOCK, _______, _______, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT \
  63. ),
  64. /* Raise
  65. * ,-----------------------------------------------------------------------------------.
  66. * | Caps | & | * | _ | ( | ) | 7 | 8 | 9 | = | Bksp | Del |
  67. * |------+------+------+------+------+-------------+------+------+------+------+------|
  68. * | Tab | $ | % | ^ | [ | ] | 4 | 5 | 6 | - | + |Enter |
  69. * |------+------+------+------+------+------|------+------+------+------+------+------|
  70. * | -> | ! | @ | # | { | } | 1 | 2 | 3 | . | \ | | |
  71. * |------+------+------+------+------+------+------+------+------+------+------+------|
  72. * | Ctrl | OS | Alt | |Shift | | 0 | Home | PgDn | PgUp | End |
  73. * `-----------------------------------------------------------------------------------'
  74. */
  75. [_RAISE] = LAYOUT_planck_1x2uR( \
  76. KC_CAPS, KC_AMPR, KC_ASTR, KC_UNDS, KC_LPRN, KC_RPRN, KC_7, KC_8, KC_9, KC_EQL, KC_BSPC, KC_DEL, \
  77. KC_TAB, KC_DLR, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_4, KC_5, KC_6, KC_MINS, KC_PLUS, _______, \
  78. CC_ARRW, KC_EXLM, KC_AT, KC_HASH, KC_LCBR, KC_RCBR, KC_1, KC_2, KC_3, _______, KC_BSLS, KC_PIPE, \
  79. _______, _______, _______, _______, _______, _______, KC_0, KC_HOME, KC_PGDN, KC_PGUP, KC_END \
  80. ),
  81. [_NAV] = LAYOUT_planck_1x2uR( \
  82. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
  83. _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, \
  84. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
  85. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
  86. )
  87. };
  88. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  89. if (record->event.pressed) {
  90. switch(keycode) {
  91. case CC_ARRW:
  92. SEND_STRING("->");
  93. return false;
  94. case CC_PRN:
  95. SEND_STRING("()"SS_TAP(X_LEFT));
  96. return false;
  97. case CC_BRC:
  98. SEND_STRING("[]"SS_TAP(X_LEFT));
  99. return false;
  100. case CC_CBR:
  101. SEND_STRING("{}"SS_TAP(X_LEFT));
  102. return false;
  103. }
  104. }
  105. return true;
  106. }
  107. // Loop
  108. void matrix_scan_user(void) {
  109. // Empty
  110. };