hex-keyboard or not. small 10x10cm 5x5 keys programmable keyboard
small brother of https://dev.sigpipe.me/DashieElectronics/dashie-keys
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.

keymap.c 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /* Copyright 2017 dashie <dashie@sigpipe.me>
  2. *
  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. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #include "dashie_hex_keyboard.h"
  17. /*
  18. * There is four layers : 0, 1, 2, 3
  19. * The layer key permit switching to the next layer, on the 3rd one, it goes
  20. * back to layer 0
  21. * See https://docs.qmk.fm/#/feature_advanced_keycodes?id=switching-and-toggling-layers
  22. */
  23. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  24. [0] = KEYMAP( /* Layer 1 */
  25. KC_P0, KC_P1, KC_P2, KC_P3, KC_P4,
  26. KC_P5, KC_P6, KC_P7, KC_P8, KC_P9,
  27. KC_A, KC_B, KC_C, KC_D, KC_E,
  28. KC_F, KC_MINS, KC_SLSH, KC_PDOT, KC_SPC,
  29. DF(1), KC_LEFT, KC_RIGHT, KC_BSPC, KC_ENTER
  30. ),
  31. [1] = KEYMAP( /* Layer 2 */
  32. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
  33. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
  34. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
  35. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
  36. DF(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
  37. ),
  38. [2] = KEYMAP( /* Layer 3 */
  39. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
  40. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
  41. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
  42. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
  43. DF(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
  44. ),
  45. [3] = KEYMAP( /* Layer 4, last one */
  46. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
  47. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
  48. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
  49. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
  50. DF(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
  51. ),
  52. };
  53. const uint16_t PROGMEM fn_actions[] = {
  54. };
  55. const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
  56. {
  57. // MACRODOWN only works in this function
  58. switch(id) {
  59. case 0:
  60. if (record->event.pressed) {
  61. register_code(KC_RSFT);
  62. } else {
  63. unregister_code(KC_RSFT);
  64. }
  65. break;
  66. }
  67. return MACRO_NONE;
  68. };
  69. void matrix_init_user(void) {
  70. }
  71. void matrix_scan_user(void) {
  72. }
  73. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  74. return true;
  75. }
  76. void led_set_user(uint8_t usb_led) {
  77. }