aboutsummaryrefslogtreecommitdiffstats
path: root/users/mechmerlin/mechmerlin.c
blob: 8d6cecd18b13b56d097380e9ca30a998040e337b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "mechmerlin.h"

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
    static uint16_t fnx_layer_timer;

    switch (keycode){
        case KC_FNX:                                    
            if(record->event.pressed){
                fnx_layer_timer = timer_read();
                layer_on(_FL);
            } else {
                layer_off(_FL);
                if (timer_elapsed(fnx_layer_timer) < 150) {  
                    layer_invert(_AL);
                }
            }
        return false;
    }
    return true;
}