1 /* Copyright 2019 Stanrc85
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #include QMK_KEYBOARD_H
25 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
30 U_LAYR, KC_0, KC_ENT),
33 KC_HOME, KC_INS, KC_PGUP,
34 KC_END, KC_UP, KC_PGDN,
35 KC_LEFT, KC_DOWN, KC_RGHT,
36 U_LAYR, TD_TWIN, D_LAYR),
39 KC_MUTE, KC_VOLD, KC_VOLU,
40 CA_QUOT, KC_MPLY, CA_SCLN,
41 CA_COPY, CA_PSTE, KC_NO,
42 U_LAYR, KC_NO, D_LAYR),
45 RGB_SAI, RGB_VAI, RGB_HUI,
46 RGB_SAD, RGB_VAD, RGB_HUD,
47 RGB_TOG, RGB_MOD, KC_NO,
48 U_LAYR, KC_NO, D_LAYR),
53 KC_NO, KC_NO, KC_MAKE,
54 KC_NO, KC_LSFT, D_LAYR)
57 bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
59 uint8_t current_layer;
62 case U_LAYR: //cycles up the layers
63 if (!record->event.pressed) {
64 current_layer = layer_switch_get_layer(key);
65 next_layer = current_layer+1;
66 layer_move(next_layer);
69 case D_LAYR: //cycles down the layers
70 if (!record->event.pressed) {
71 current_layer = layer_switch_get_layer(key);
72 next_layer = current_layer-1;
73 layer_move(next_layer);