logo

qmk_firmware

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

keymap.c (2147B)


  1. #include QMK_KEYBOARD_H
  2. // Each layer gets a name for readability, which is then used in the keymap matrix below.
  3. // The underscores don't mean anything - you can have a layer called STUFF or any other name.
  4. // Layer names don't all need to be of the same length, obviously, and you can also skip them
  5. // entirely and just use numbers.
  6. enum honeycomb_layers {
  7. _BS,
  8. _EN
  9. };
  10. // Macro definitions for readability
  11. enum honeycomb_keycodes {
  12. HW = SAFE_RANGE,
  13. COPY,
  14. PASTA
  15. };
  16. extern int8_t encoderValue;
  17. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  18. [_BS] = LAYOUT( /* Base layout, put whatever defaults. */
  19. HW, COPY, PASTA, KC_MUTE,
  20. KC_4, KC_5, KC_6, KC_7,
  21. KC_8, KC_9, KC_A, KC_B,
  22. KC_C, KC_D, KC_E, KC_F
  23. ),
  24. [_EN] = LAYOUT( /* Alternate layer */
  25. _______, _______, _______, _______,
  26. _______, _______, _______, _______,
  27. _______, _______, _______, _______,
  28. _______, _______, _______, _______
  29. )
  30. };
  31. report_mouse_t currentReport = {};
  32. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  33. //uint8_t layer = get_highest_layer(layer_state); // get the current layer
  34. // Basic example functions
  35. switch (keycode) {
  36. case HW:
  37. if (record->event.pressed) {
  38. SEND_STRING("Hello, world!");
  39. } else {
  40. SEND_STRING("Goodbye, cruel world!");
  41. }
  42. break;
  43. case COPY:
  44. if (record->event.pressed) {
  45. tap_code16(LCTL(KC_C)); // Replace with tap_code16(LCMD(KC_C)) to enable for Mac
  46. }
  47. break;
  48. case PASTA:
  49. if (record->event.pressed) {
  50. tap_code16(LCTL(KC_V)); // Replace with tap_code16(LCMD(KC_V)) to enable for Mac
  51. }
  52. break;
  53. return false;
  54. }
  55. return true;
  56. };
  57. void matrix_scan_user(void) {
  58. /* Leaving some LED stuff in here in comment form so you can see how to use it.
  59. if (shiftLED || capsLED){
  60. red_led_on;
  61. } else {
  62. red_led_off;
  63. }
  64. if (numLED){
  65. grn_led_on;
  66. } else {
  67. grn_led_off;
  68. }
  69. if (mouseLED){
  70. blu_led_on;
  71. } else {
  72. blu_led_off;
  73. }*/
  74. while (encoderValue < 0){
  75. tap_code(KC_VOLD);
  76. encoderValue++;
  77. }
  78. while (encoderValue > 0){
  79. tap_code(KC_VOLU);
  80. encoderValue--;
  81. }
  82. };