Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. #include QMK_KEYBOARD_H
  2.  
  3. extern keymap_config_t keymap_config;
  4.  
  5. // Each layer gets a name for readability, which is then used in the keymap matrix below.
  6. // The underscores don't mean anything - you can have a layer called STUFF or any other name.
  7. // Layer names don't all need to be of the same length, obviously, and you can also skip them
  8. // entirely and just use numbers.
  9. #define _BASE 0
  10. #define _FN1 1
  11. #define KC_COPY LCTL(KC_C)
  12.  
  13. enum custom_keycodes {
  14. COPA = SAFE_RANGE,
  15. HPIM
  16. };
  17.  
  18. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  19. switch(keycode) {
  20. case HPIM:
  21. if (record->event.pressed) {
  22. // when keycode HPIM is pressed
  23. SEND_STRING("QMK is the best thing ever!");
  24. } else {
  25. // when keycode HPIM is released
  26. }
  27. break;
  28. case COPA:
  29. if (record->event.pressed) {
  30. SEND_STRING( SS_LCTRL("c"));
  31. } else {
  32. SEND_STRING( SS_LCTRL("v"));
  33. }
  34. return false;
  35. }
  36. return true;
  37. };
  38.  
  39. enum {
  40. TD_Q_COPY = 0
  41. };
  42. qk_tap_dance_action_t tap_dance_actions[] = {
  43. [TD_Q_COPY] = ACTION_TAP_DANCE_DOUBLE(KC_Q, KC_COPY)
  44.  
  45. };
  46.  
  47.  
  48. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  49. [_BASE] = LAYOUT(
  50. KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, _______, KC_BSPC, \
  51. KC_TAB, TD(TD_Q_COPY), KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \
  52. KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
  53. KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \
  54. KC_LCTL, HPIM, KC_LALT, COPA, KC_COPY, KC_SPC,_______, KC_RALT, KC_LGUI, _______, MO(_FN1), KC_RCTL
  55. ),
  56.  
  57. [_FN1] = LAYOUT(
  58. KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, \
  59. _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
  60. _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______,\
  61. RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
  62. KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
  63. )
  64. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement