summaryrefslogtreecommitdiffstats
path: root/keyboards/handwired/onekey/keymaps/quine/keymap.c
blob: e7c1e6d0644ed35073de551506e3d74734816ac7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include <handwired/onekey/onekey.h>
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT_ortho_1x1(KC_A) };
const char *buf[30] = {
"#include <handwired/onekey/onekey.h>",
"const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT_ortho_1x1(KC_A) };",
"const char *buf[30] = {",
"",
"};",
"bool process_record_user(uint16_t keycode, keyrecord_t *record) {",
"  switch(keycode) {",
"    case KC_A:",
"      if (record->event.pressed) {",
"        for (int i = 0; i < 3; i++) {",
"          send_string(buf[i]);",
"          tap_code(KC_ENT);",
"        }",
"        for (int i = 0; i < 30; i++) {",
"          send_string(buf[3]);",
"          tap_code16(S(KC_QUOT));",
"          send_string(buf[i]);",
"          tap_code16(S(KC_QUOT));",
"          tap_code(KC_COMM);",
"          tap_code(KC_ENT);",
"        }",
"        for (int i = 4; i < 30; i++) {",
"          send_string(buf[i]);",
"          tap_code(KC_ENT);",
"        }",
"      }",
"      return false;",
"  }",
"  return true;",
"};",
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  switch(keycode) {
    case KC_A:
      if (record->event.pressed) {
        for (int i = 0; i < 3; i++) {
          send_string(buf[i]);
          tap_code(KC_ENT);
        }
        for (int i = 0; i < 30; i++) {
          send_string(buf[3]);
          tap_code16(S(KC_QUOT));
          send_string(buf[i]);
          tap_code16(S(KC_QUOT));
          tap_code(KC_COMM);
          tap_code(KC_ENT);
        }
        for (int i = 4; i < 30; i++) {
          send_string(buf[i]);
          tap_code(KC_ENT);
        }
      }
      return false;
  }
  return true;
};