-
Notifications
You must be signed in to change notification settings - Fork 0
/
mikybars.c
37 lines (31 loc) · 965 Bytes
/
mikybars.c
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
#include QMK_KEYBOARD_H
#include "mikybars.h"
#include "features/layer_lock.h"
// Tap Dance definitions
tap_dance_action_t tap_dance_actions[] = {
// Tap once for Escape, twice for Caps Lock
[ACC_I] = ACTION_TAP_DANCE_DOUBLE(KC_I, KC_A),
};
bool process_record_user(uint16_t keycode, keyrecord_t* record) {
const uint8_t mods = get_mods();
const bool shifted = (mods | get_weak_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT;
if (!process_layer_lock(keycode, record, LLOCK)) { return false; }
if (record->event.pressed) {
switch (keycode) {
case KC_QUOT:
if (shifted) {
unregister_code(KC_LSFT);
register_code(KC_QUOT);
unregister_code(KC_QUOT);
register_code(KC_LSFT);
} else {
register_code(KC_LSFT);
register_code(KC_QUOT);
unregister_code(KC_QUOT);
unregister_code(KC_LSFT);
}
return false;
}
}
return true;
}