blob: 0244ac0959471f8bce99104813716eb4c0dc40ab (
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
|
// TODO: Improve this currently there is no feedback if activated by other means.
bool CAPS_LOCK = false;
bool NUM_LOCK = false;
bool SCROLL_LOCK = false;
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (!process_record_dynamic_macro(keycode, record)) {
return false;
}
switch (keycode) {
case KC_CAPS_LOCK:
if (record->event.pressed) {
if (!(CAPS_LOCK)) {
ergodox_right_led_1_on();
CAPS_LOCK = true;
} else {
ergodox_right_led_1_off();
CAPS_LOCK = false;
}
}
return true;
case KC_NUM_LOCK:
if (record->event.pressed) {
if (!(NUM_LOCK)) {
ergodox_right_led_2_on();
NUM_LOCK = true;
} else {
ergodox_right_led_2_off();
NUM_LOCK = false;
}
}
return true;
case KC_SCROLL_LOCK:
if (record->event.pressed) {
if (!(SCROLL_LOCK)) {
ergodox_right_led_3_on();
SCROLL_LOCK = true;
} else {
ergodox_right_led_3_off();
SCROLL_LOCK = false;
}
}
return true;
case KC_MS_WH_UP ... KC_MS_WH_RIGHT:
if (record->event.pressed) {
if (SCROLL_LOCK) {
return false;
} else {
return true;
}
}
case MY_CUSTOM_MACRO:
if (record->event.pressed) {
SEND_STRING("QMK is the best thing ever!"); // this is our macro!
return false;
}
case MY_OTHER_MACRO:
if (record->event.pressed) {
SEND_STRING(SS_LCTRL("ac")); // selects all and copies
return false;
}
default:
return true;
}
}
|