aboutsummaryrefslogtreecommitdiffstats
path: root/keyboards/bastardkb/skeletyl/keymaps/quotengrote/keymap.c
blob: 81d92d4fd1947bce196dbe531325167962b06126 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
#include QMK_KEYBOARD_H
#include "keymap_german.h"

// layers
enum layers {
    _BASE,
    _NUM,
    _SYM,
    _MOV,
    _MEDIA
};


// rgb
void keyboard_post_init_user(void) {
  rgblight_enable_noeeprom(); // Enables RGB, without saving settings
  rgblight_sethsv(4, 75, 150); // warmwhite (werte = hue, saturation, value)
  rgblight_mode_noeeprom(RGB_MATRIX_SOLID_COLOR);
}
bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
// https://colorpicker.me/#fff115
  // shift rgb
  uint8_t mods = get_mods() | get_weak_mods() | get_oneshot_mods();
  if ((mods) & MOD_MASK_SHIFT ) {
    // "Shift"-Color
      rgb_matrix_set_color(10, 235, 56, 19); // 50 shades of orange
      rgb_matrix_set_color(11, 235, 56, 19); // 50 shades of orange
      rgb_matrix_set_color(28, 235, 56, 19); // 50 shades of orange
      rgb_matrix_set_color(29, 235, 56, 19); // 50 shades of orange
  };
  // layer rgb
  for (uint8_t i = led_min; i < led_max; i++) {
    switch(get_highest_layer(layer_state|default_layer_state)) {
      //base
      case 0:
        rgblight_sethsv(4, 75, 150); // warmwhite (werte = hue, saturation, value)
        break;
      // NUM
      case 1:
        // <led-index> {siehe ../../skeletyl.c) <rgb-wert>
        // color thumbs
        rgb_matrix_set_color(35, 255, 165, 0); // orange
        rgb_matrix_set_color(34, 255, 165, 0); // orange
        rgb_matrix_set_color(33, 255, 165, 0); // orange
        // F-Keys
        rgb_matrix_set_color(2,  20, 214, 22); // 50 shades of green
        rgb_matrix_set_color(3,  20, 214, 22); // 50 shades of green
        rgb_matrix_set_color(8,  20, 214, 22); // 50 shades of green
        rgb_matrix_set_color(9,  20, 214, 22); // 50 shades of green
        rgb_matrix_set_color(12, 20, 214, 22); // 50 shades of green
        rgb_matrix_set_color(30, 20, 214, 22); // 50 shades of green
        rgb_matrix_set_color(27, 20, 214, 22); // 50 shades of green
        rgb_matrix_set_color(26, 20, 214, 22); // 50 shades of green
        rgb_matrix_set_color(21, 20, 214, 22); // 50 shades of green
        rgb_matrix_set_color(20, 20, 214, 22); // 50 shades of green
        rgb_matrix_set_color(32, 20, 214, 22); // 50 shades of green
        rgb_matrix_set_color(29, 20, 214, 22); // 50 shades of green
        rgb_matrix_set_color(18, 20, 214, 22); // 50 shades of green
        // Digits
        rgb_matrix_set_color(1,  255, 165, 0); // orange
        rgb_matrix_set_color(4,  255, 165, 0); // orange
        rgb_matrix_set_color(7,  255, 165, 0); // orange
        rgb_matrix_set_color(10, 255, 165, 0); // orange
        rgb_matrix_set_color(13, 255, 165, 0); // orange
        rgb_matrix_set_color(31, 255, 165, 0); // orange
        rgb_matrix_set_color(28, 255, 165, 0); // orange
        rgb_matrix_set_color(25, 255, 165, 0); // orange
        rgb_matrix_set_color(22, 255, 165, 0); // orange
        rgb_matrix_set_color(19, 255, 165, 0); // orange
        // BSPC
        rgb_matrix_set_color(20, 44, 0, 207); // 50 shades of blue
        break;
      // SYM
      case 2:
        // color thumbs
        rgb_matrix_set_color(15, 0, 90, 255); // blue
        rgb_matrix_set_color(16, 0, 90, 255); // blue
        rgb_matrix_set_color(17, 0, 90, 255); // blue
        // color pairs
        // ´`
        rgb_matrix_set_color(5,  20, 214, 22); // 50 shades of green
        rgb_matrix_set_color(11, 20, 214, 22); // 50 shades of green
        // []
        rgb_matrix_set_color(3,  44, 0, 232); // 50 shades of blue
        rgb_matrix_set_color(21, 44, 0, 232); // 50 shades of blue
        // ()
        rgb_matrix_set_color(8,  44, 0, 207); // 50 shades of blue
        rgb_matrix_set_color(26, 44, 0, 207); // 50 shades of blue
        // {}
        rgb_matrix_set_color(9,  44, 0, 171); // 50 shades of blue
        rgb_matrix_set_color(27, 44, 0, 171); // 50 shades of blue
        // \/
        rgb_matrix_set_color(13, 235, 235, 19); // 50 shades of yellow
        rgb_matrix_set_color(31, 235, 235, 19); // 50 shades of yellow
        // <>
        rgb_matrix_set_color(14, 235, 56, 19); // 50 shades of red
        rgb_matrix_set_color(32, 235, 56, 19); // 50 shades of red
        break;
      // MOV
      case 3:
        // color thumbs
        rgb_matrix_set_color(35, 4, 147, 4); // green
        rgb_matrix_set_color(34, 4, 147, 4); // green
        rgb_matrix_set_color(33, 4, 147, 4); // green
        rgb_matrix_set_color(15, 4, 147, 4); // green
        rgb_matrix_set_color(16, 4, 147, 4); // green
        rgb_matrix_set_color(17, 4, 147, 4); // green
        // color pairs
        // PGUP/PGDOWN
        rgb_matrix_set_color(27, 20, 214, 22); // 50 shades of green
        rgb_matrix_set_color(29, 20, 214, 22); // 50 shades of green
        // HOME/END
        rgb_matrix_set_color(21, 44, 0, 232); // 50 shades of blue
        rgb_matrix_set_color(23, 44, 0, 232); // 50 shades of blue
        // Arrows
        rgb_matrix_set_color(26, 235, 235, 19); // 50 shades of yellow
        rgb_matrix_set_color(25, 235, 235, 19); // 50 shades of yellow
        rgb_matrix_set_color(28, 235, 235, 19); // 50 shades of yellow
        rgb_matrix_set_color(22, 235, 235, 19); // 50 shades of yellow
        // TAB
        rgb_matrix_set_color(1,  235, 235, 19); // 50 shades of yellow
        // WIN
        rgb_matrix_set_color(3,  235, 235, 19); // 50 shades of yellow
        // BSPC
        rgb_matrix_set_color(20, 235, 235, 19); // 50 shades of yellow
        break;
      // MEDIA
      case 4:
        // color thumbs
        rgb_matrix_set_color(35, 255, 241, 21); // yellow
        rgb_matrix_set_color(34, 255, 241, 21); // yellow
        rgb_matrix_set_color(33, 255, 241, 21); // yellow
        rgb_matrix_set_color(15, 255, 241, 21); // yellow
        rgb_matrix_set_color(16, 255, 241, 21); // yellow
        rgb_matrix_set_color(17, 255, 241, 21); // yellow
        break;
      default:
        rgblight_sethsv(4, 75, 150); // warmwhite (werte = hue, saturation, value)
        break;
    }
  }
  return false;
}

// combos; https://github.com/qmk/qmk_firmware/blob/master/docs/feature_combo.md
enum combos {
  C_ALT,
  C_KA,
  C_KK,
  C_ESC,
  C_MED,
  C_SV, // Strg + S
  C_WE // Windows Explorer
};

const uint16_t PROGMEM alt_combo[] = {LCTL_T(KC_E),     KC_I,           COMBO_END};
const uint16_t PROGMEM ka_combo[]  = {KC_R,             LSFT_T(KC_T),   COMBO_END};
const uint16_t PROGMEM kk_combo[]  = {LSFT_T(KC_N),     KC_I,           COMBO_END};
const uint16_t PROGMEM esc_combo[] = {LCTL_T(KC_S),     LSFT_T(KC_T),   COMBO_END};
const uint16_t PROGMEM med_combo[] = {LT(_MOV, KC_DEL), MO(_MOV),       COMBO_END};
const uint16_t PROGMEM sv_combo[]  = {LCTL_T(KC_S),     LT(_BASE,KC_C), COMBO_END};
const uint16_t PROGMEM we_combo[]  = {LT(_BASE,KC_W),   LCTL_T(KC_E),   COMBO_END};

combo_t key_combos[] = {
  [C_ALT] = COMBO(alt_combo, KC_LALT),
  [C_KA]  = COMBO(ka_combo,  LCTL(LALT(KC_A))),
  [C_KK]  = COMBO(kk_combo,  LCTL(LALT(KC_K))),
  [C_ESC] = COMBO(esc_combo, KC_ESC),
  [C_MED] = COMBO(med_combo, MO(_MEDIA)),
  [C_SV]  = COMBO(sv_combo,  LCTL(KC_S)),
  [C_WE]  = COMBO(we_combo,  LGUI(KC_E)),
};

// keymap
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  // Buchstaben - white
  [_BASE] = LAYOUT_split_3x5_3(
      LT(_BASE,KC_Q), LT(_BASE,KC_W), LT(_BASE,KC_F), KC_P,             KC_B,             KC_J,             KC_L,          LT(_BASE,KC_U), DE_Z,   KC_BSPC,
      LT(_BASE,KC_A), KC_R,           LCTL_T(KC_S),   LSFT_T(KC_T),     KC_G,             KC_M,             LSFT_T(KC_N),  LCTL_T(KC_E),   KC_I,   LT(_BASE,KC_O),
      LT(_BASE,DE_Y), LT(_BASE,KC_X), LT(_BASE,KC_C), LSFT_T(KC_D),     LT(_BASE,KC_V),   KC_K,             LSFT_T(KC_H),  DE_COMM,        DE_DOT, DE_MINS,
                                      XXXXXXX,        LT(_MOV, KC_DEL), LT(_SYM, KC_ENT), LT(_NUM, KC_SPC), MO(_MOV),      XXXXXXX
  ),
  // Zahlen - orange
  [_NUM] = LAYOUT_split_3x5_3(
      KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,              KC_F6,   KC_F7,   KC_F8,   KC_F9,   KC_BSPC,
      KC_1,    KC_2,    KC_3,    KC_4,    KC_5,               KC_6,    KC_7,    KC_8,    KC_9,    KC_0,
      XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,            KC_F10,  KC_F11,  _______, _______, KC_F12,
                        XXXXXXX, _______, _______,            _______, _______, XXXXXXX
  ),
  // Sym - blue
  [_SYM] = LAYOUT_split_3x5_3(
      DE_CIRC, DE_LBRC, DE_LPRN,  DE_LPRN,       DE_SECT,         DE_PERC,     DE_RCBR, DE_RPRN, DE_RBRC, KC_BSPC,
      DE_EXLM, DE_DQUO, DE_SS,    DE_QUOT,       DE_SLSH,         RALT(DE_SS), DE_DLR,  DE_AMPR, DE_ASTR, DE_QUES,
      DE_TILD, DE_ACUT, XXXXXXX,  LSFT(DE_ACUT), DE_LABK ,        DE_RABK ,    XXXXXXX, DE_PLUS, DE_EQL,  DE_HASH,
                        XXXXXXX,  _______,       _______,         _______,     _______, XXXXXXX
  ),
  // Move - green
  [_MOV] = LAYOUT_split_3x5_3(
      XXXXXXX, KC_LGUI, XXXXXXX, XXXXXXX, XXXXXXX,          XXXXXXX, KC_PGUP, KC_UP,   KC_HOME,  KC_BSPC,
      KC_TAB,  XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,          XXXXXXX, KC_LEFT, KC_DOWN, KC_RIGHT, KC_DEL,
      XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,          XXXXXXX, KC_PGDN, XXXXXXX, KC_END,   XXXXXXX,
                        XXXXXXX, _______, _______,          _______, _______, XXXXXXX
  ),
  // Media - yellow
  [_MEDIA] = LAYOUT_split_3x5_3(
      RGB_TOG, XXXXXXX, XXXXXXX, KC_PSCR, KC_VOLU,            KC_VOLU, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
      XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE,            KC_MUTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
      XXXXXXX, XXXXXXX, XXXXXXX, KC_MPLY, KC_VOLD,            KC_VOLD, KC_MPLY, XXXXXXX, XXXXXXX, XXXXXXX,
                        XXXXXXX, _______, _______,            _______, _______, XXXXXXX
  )
};

// https://github.com/qmk/qmk_firmware/blob/master/docs/mod_tap.md#changing-hold-function
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  switch (keycode) {
    // "Tap and Hold"
    case LT(_BASE,KC_X): // "LT(_BASE,KC_X)" is the keycode that must be mapped
      if (!record->tap.count && record->event.pressed) {
        tap_code16(LCTL(KC_X)); // Intercept hold function to send Ctrl-X
        return false;
      }
      return true; // Return true for normal processing of tap keycode
    case LT(_BASE,DE_Y):
      if (!record->tap.count && record->event.pressed) {
        tap_code16(DE_PIPE);
        return false;
      }
      return true;
    case LT(_BASE,KC_C):
      if (!record->tap.count && record->event.pressed) {
        tap_code16(LCTL(KC_C));
        return false;
      }
      return true;
    case LT(_BASE,KC_V):
      if (!record->tap.count && record->event.pressed) {
        tap_code16(LCTL(KC_V));
        return false;
      }
      return true;
    case LT(_BASE,KC_Q):
      if (!record->tap.count && record->event.pressed) {
        tap_code16(RALT(KC_Q));
        return false;
      }
      return true;
    case LT(_BASE,KC_F):
      if (!record->tap.count && record->event.pressed) {
        tap_code16(RALT(KC_E));
        return false;
      }
      return true;
    case LT(_BASE,KC_A):
      if (!record->tap.count && record->event.pressed) {
        tap_code16(DE_ADIA);
        return false;
      }
      return true;
    case LT(_BASE,KC_O):
      if (!record->tap.count && record->event.pressed) {
        tap_code16(DE_ODIA);
        return false;
      }
      return true;
    case LT(_BASE,KC_U):
      if (!record->tap.count && record->event.pressed) {
        tap_code16(DE_UDIA);
        return false;
      }
      return true;
    case LT(_BASE,KC_W):
      if (!record->tap.count && record->event.pressed) {
        tap_code16(KC_LGUI);
        return false;
      }
      return true;
  }
  return true;
}