forked from qmk/qmk_userspace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquick_game_type.c
38 lines (33 loc) · 952 Bytes
/
quick_game_type.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
38
// Copyright 2024 Javier Oliver (@joliverMI)
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include QMK_KEYBOARD_H
uint8_t original_layer = 0;
bool process_quick_game_type(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case CTT:
if (record->event.pressed) {
original_layer = get_highest_layer(layer_state);
layer_on(TEMP_TYPE_LAYER);
layer_off(original_layer);
register_code(KC_ENT);
} else {
// unregister_code(KC_Y);
unregister_code(KC_ENT);
}
return false;
break;
case TTC:
if (record->event.pressed) {
layer_on(original_layer);
layer_off(TEMP_TYPE_LAYER);
register_code(KC_ENT);
} else {
// unregister_code(KC_N);
unregister_code(KC_ENT);
}
return false;
break;
}
return true;
}