summaryrefslogtreecommitdiff
path: root/keyboards/moonlander/keymaps/jjerrell/keymap.c
blob: ee6226177f69b95b926c2bae89e3e796eafd5036 (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/**
 * Copyright (C) 2021 Jerrell, Jacob <@jjerrell>
 * 
 * This file is part of qmk_firmware.
 * 
 * qmk_firmware is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * qmk_firmware is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with qmk_firmware.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "jjerrell.h"

enum moonlander_layers {
    _GAME_LOWER = LAYER_SAFE_RANGE,
    // _GAME_RAISE,
};

// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [_WORKMAN] = LAYOUT_moonlander_mods(
        __________________WORKMN_L1__________________, __________________WORKMN_R1__________________,
        __________________WORKMN_L2__________________, __________________WORKMN_R2__________________,
        __________________WORKMN_L3__________________, __________________WORKMN_R3__________________,
        XXXXXXX, XXXXXXX, XXXXXXX, KC_LSFT,                       KC_RSFT, XXXXXXX, XXXXXXX, XXXXXXX
    ),

    [_LOWER] = LAYOUT_moonlander_mods(
        __________________LOWER_L1___________________, __________________LOWER_R1___________________,
        __________________LOWER_L2___________________, __________________LOWER_R2___________________,
        __________________LOWER_L3___________________, __________________LOWER_R3___________________,
          XXXXXXX, XXXXXXX, XXXXXXX, KC_LSFT,                         KC_0, KC_DOT, KC_COMM, KC_PLUS
    ),

    [_RAISE] = LAYOUT_moonlander_common(
        __________________RAISE_L1___________________, __________________RAISE_R1___________________,
        __________________RAISE_L2___________________, __________________RAISE_R2___________________,
        __________________RAISE_L3___________________, __________________RAISE_R3___________________,
        XXXXXXX, XXXXXXX, XXXXXXX, KC_LSFT,                       KC_RSFT, XXXXXXX, XXXXXXX, XXXXXXX
    ),

    [_ADJUST] = LAYOUT_moonlander_common(
        __________________ADJUST_L1__________________, __________________ADJUST_R1__________________,
        __________________ADJUST_L2__________________, __________________ADJUST_R2__________________,
        __________________ADJUST_L3__________________, __________________ADJUST_R3__________________,
        XXXXXXX, XXXXXXX, XXXXXXX, KC_LSFT,                       KC_RSFT, XXXXXXX, XXXXXXX, XXXXXXX
    ),

    [_SPECIAL] = LAYOUT_moonlander_common(
        XXXXXXX, XXXXXXX, KC_WH_D, XXXXXXX, XXXXXXX,     XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
        XXXXXXX, KC_WH_L, KC_WH_U, KC_WH_R, XXXXXXX,     XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
        XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,     XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
        XXXXXXX, XXXXXXX, XXXXXXX, KC_LALT,                       KC_RALT, XXXXXXX, XXXXXXX, XXXXXXX
    ),

    [_GAME] = LAYOUT_moonlander_gamepad(
        KC_ESC,  KC_1,     KC_2,      KC_3,     KC_4,     KC_5, KC_6,
        KC_TAB,  __________________QWERTY_L1__________________, KC_SLSH,
        KC_LALT, __________________QWERTY_L2__________________, KC_BSLS,
        KC_LSFT, __________________QWERTY_L3__________________,
        KC_LGUI, MACRO_1, MACRO_2, MACRO_3, MACRO_4,   QK_LOCK,
                                    KC_SPC, KC_BTN2, MO(_LOWER)
    ),
    [_GAME_LOWER] = LAYOUT_moonlander_gamepad(
        KC_GRV,  KC_7,     KC_8,      KC_9,     KC_0,  KC_MINS, KC_EQL,
        KC_TAB,  __________________QWERTY_L1__________________, KC_SLSH,
        KC_LALT, __________________QWERTY_L2__________________, KC_BSLS,
        KC_LSFT, __________________QWERTY_L3__________________,
        KC_LGUI, MACRO_5, MACRO_6, MACRO_7, MACRO_8,   QK_LOCK,
                                    KC_SPC, KC_BTN2, MO(_LOWER)
    )
};
// clang-format on

layer_state_t layer_state_set_keymap(layer_state_t state) {
    ML_LED_1(0);
    ML_LED_2(0);
    ML_LED_3(0);
    ML_LED_4(0);
    ML_LED_5(0);
    ML_LED_6(0);
    state = update_tri_layer_state(state, _GAME, _LOWER, _GAME_LOWER);
    switch (get_highest_layer(state)) {
        case 1:
            ML_LED_1(1);
            ML_LED_4(1);
            break;
        case 2:
            ML_LED_2(1);
            ML_LED_5(1);
            break;
        case 3:
            ML_LED_3(1);
            break;
        case 4:
            ML_LED_4(1);
            break;
        case 5:
            ML_LED_5(1);
            break;
        case 6:
            ML_LED_6(1);
            break;
        default:
            break;
    }

    return state;
}