logo

qmk_firmware

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

keymap.c (1791B)


  1. // Copyright 2023 Noah Beidelman (@noahbei)
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #include QMK_KEYBOARD_H
  4. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  5. /*
  6. * ┌───┐
  7. * │Tog│
  8. * ├───┼───┬───┐
  9. * │ 7 │ 8 │ 9 │
  10. * ├───┼───┼───┤
  11. * │ 4 │ 5 │ 6 │
  12. * ├───┼───┼───┤
  13. * │ 1 │ 2 │ 3 │
  14. * └───┴───┴───┘
  15. */
  16. [0] = LAYOUT(
  17. LT(0, KC_NO),
  18. KC_7, KC_8, KC_9,
  19. KC_4, KC_5, KC_6,
  20. KC_1, KC_2, KC_3
  21. ),
  22. [1] = LAYOUT(
  23. LT(0, KC_NO),
  24. KC_A, KC_B, KC_C,
  25. KC_D, KC_E, KC_F,
  26. KC_G, KC_H, KC_I
  27. ),
  28. [2] = LAYOUT(
  29. LT(0, KC_NO),
  30. KC_J, KC_K, KC_L,
  31. KC_M, KC_N, KC_O,
  32. KC_P, KC_Q, KC_R
  33. ),
  34. [3] = LAYOUT(
  35. LT(0, KC_NO),
  36. KC_S, KC_T, KC_U,
  37. KC_V, KC_W, KC_X,
  38. KC_Y, KC_Z, KC_ENT
  39. )
  40. };
  41. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  42. switch(keycode) {
  43. case LT(0, KC_NO):
  44. if (record->event.pressed) {
  45. // on tap
  46. if (record->tap.count) {
  47. if (get_highest_layer(layer_state) >= 3) {
  48. layer_clear();
  49. } else {
  50. layer_move(get_highest_layer(layer_state) + 1);
  51. }
  52. }
  53. #ifdef OLED_ENABLE
  54. // on hold
  55. else {
  56. void oled_display_mode_step(void);
  57. oled_display_mode_step();
  58. }
  59. #endif
  60. }
  61. return false;
  62. }
  63. return true;
  64. }