forked from Galzai/MK32
-
Notifications
You must be signed in to change notification settings - Fork 0
/
keymap.c
160 lines (134 loc) · 8.19 KB
/
keymap.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
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#ifndef KEYMAP_C
#define KEYMAP_C
#include "key_definitions.h"
#include "keyboard_config.h"
#include "keymap.h"
#include "plugins.h"
// A bit different from QMK, default returns you to the first layer, LOWER and raise increase/lower layer by order.
#define DEFAULT 0x100
#define LOWER 0x101
#define RAISE 0x102
// Keymaps are designed to be relatively interchangeable with QMK
enum custom_keycodes {
QWERTY, NUM,
PLUGINS,
};
//Set these for each layer and use when layers are needed in a hold-to use layer
enum layer_holds {
QWERTY_H = LAYER_HOLD_BASE_VAL, NUM_H,FUNCS_H
};
// array to hold names of layouts for oled
char default_layout_names[LAYERS][MAX_LAYOUT_NAME_LENGTH] = { "QWERTY", "NUM",
"Plugins",
};
/* select a keycode for your macro
* important - first macro must be initialized as MACRO_BASE_VAL
* */
#define MACROS_NUM 2
enum custom_macros {
KC_CTRL_ALT_DELETE = MACRO_BASE_VAL, KC_ALT_F4,
};
/*define what the macros do
* important- make sure you you put the macros in the same order as the their enumeration
*/
uint16_t macros[MACROS_NUM][MACRO_LEN] = {
// CTRL+ALT+DEL
{ KC_LCTRL, KC_LALT, KC_DEL },
//ALT +F4
{ KC_RALT, KC_LALT, KC_NO } };
/*Encoder keys for each layer by order, and for each pad
* First variable states what usage the encoder has
*/
uint16_t default_encoder_map[LAYERS][ENCODER_SIZE] = {
// |VOL + | VOL - | MUTE |
{ MEDIA_ENCODER, KC_AUDIO_VOL_UP, KC_AUDIO_VOL_DOWN, KC_AUDIO_MUTE },
// |Y+|Y-| LEFT CLICK|
{ MOUSE_ENCODER, KC_MS_UP, KC_MS_DOWN, KC_MS_BTN1 },
{ MOUSE_ENCODER, KC_MS_UP, KC_MS_DOWN, KC_MS_BTN1 } };
uint16_t default_slave_encoder_map[LAYERS][ENCODER_SIZE] = {
// |VOL + | VOL - | MUTE |
{ MOUSE_ENCODER, KC_MS_WH_UP, KC_MS_WH_DOWN , KC_AUDIO_MUTE },
// |Y+|Y-| LEFT CLICK|
{ MOUSE_ENCODER, KC_MS_RIGHT, KC_MS_LEFT, KC_MS_BTN2 },
// |Y+|Y-| LEFT CLICK|
{ MOUSE_ENCODER, KC_MS_RIGHT, KC_MS_LEFT, KC_MS_BTN2 } };
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
//NOTE: For this keymap due to wiring constraints the the two last rows on the left are wired unconventionally
// Each keymap is represented by an array, with an array that points to all the keymaps by order
uint16_t _QWERTY[MATRIX_ROWS][KEYMAP_COLS]={
/* Qwerty
* ,-----------------------------------------. .-----------------------------------------.
* | ~ | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - |
* |------+------+------+-------+------+------| |-------+------+------+------+------+------|
* | Esc | Q | W | E | R | T | | Y | U | I | O | P | = |
* |------+------+------+-------+------+------| |-------+------+------+------+------+------|
* | Tab | A | S | D | F | G | | H | J | K | L | ; | ' |
* |------+------+------+-------+------+------| |-------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | | N | M | , | . | / | up |
* |------+------+------+-------+------+------| |-------+------+------+------+------+------|
* | Ctrl | GUI | Alt | Space |Space |NUM_H | | Del |Bspc |Enter | Left | Right |Down |
* `------------------------------------------' ------------------------------------------'
* |default |RAISE| |lower|NUM |
* -------------- ---------------
*/
{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS },
{KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_EQUAL},
{KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT },
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP } ,
{KC_LCTRL,KC_LGUI, KC_LALT, KC_SPC, KC_SPC, NUM_H, KC_DEL, NUM, LOWER, KC_BSPC, KC_ENT, KC_LEFT },
{DEFAULT,RAISE, KC_NONE, KC_NONE, KC_NONE, KC_NONE, KC_RIGHT, KC_DOWN, KC_NONE, KC_NONE, KC_NONE, KC_NONE }
};
uint16_t _NUM[MATRIX_ROWS][KEYMAP_COLS]={
/* Nums
* ,-----------------------------------------. .-----------------------------------------.
* | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 |
* |------+------+------+-------+------+------| |-------+------+------+------+------+------|
* | Esc | Q | W | E | R | T | | Y | U | I | [ | ] | \ |
* |------+------+------+-------+------+------| |-------+------+------+------+------+------|
* | Tab | A | S | D | F | G | | H | J | K | L | ; | ' |
* |------+------+------+-------+------+------| |-------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | | N | M | , | . | / | up |
* |------+------+------+-------+------+------| |-------+------+------+------+------+------|
* | Ctrl | GUI | Alt | Space |Space |NUM_H | | Del |Bspc |Enter | Left | Right |Down |
* `------------------------------------------' ------------------------------------------'
* |default |RAISE| |lower|NUM |
* -------------- ---------------
*/
{ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10,KC_F11, KC_F12 },
{KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_LBRC, KC_RBRC, KC_BSLASH },
{KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT },
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_EQUAL } ,
{KC_LCTRL,KC_LGUI, KC_LALT, KC_SPC, KC_SPC, NUM_H, KC_DEL, NUM, LOWER, KC_BSPC, KC_ENT, KC_LEFT },
{DEFAULT,RAISE, KC_NONE, KC_NONE, KC_NONE, KC_NONE, KC_RIGHT, KC_DOWN, KC_NONE, KC_NONE, KC_NONE, KC_NONE }
};
uint16_t _PLUGINS[MATRIX_ROWS][KEYMAP_COLS]={
/* Plugins
* ,-----------------------------------------. .-----------------------------------------.
* | ~ | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - |
* |------+------+------+-------+------+------| |-------+------+------+------+------+------|
* | Esc | Q | W | E | R | T | | Y | U | I | O | P | = |
* |------+------+------+-------+------+------| |-------+------+------+------+------+------|
* | Tab | A | S | D | F | G | | H | J | K | L | ; | ' |
* |------+------+------+-------+------+------| |-------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | | N | M | , | . | / | up |
* |------+------+------+-------+------+------| |-------+------+------+------+------+------|
* | Ctrl | GUI | Alt | Space |Space |NUM_H | | Del |Bspc |Enter | Left | Right |Down |
* `------------------------------------------' ------------------------------------------'
* |default |RAISE| |lower|NUM |
* -------------- ---------------
*/
{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC },
{KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC },
{KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT },
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT } ,
{KC_LCTRL,KC_LGUI, KC_LALT, KC_SPC, KC_SPC, NUM_H, KC_DEL, NUM, LOWER, KC_BSPC, KC_ENT, KC_LEFT },
{DEFAULT,RAISE, KC_NONE, KC_NONE, KC_NONE, KC_NONE, KC_RIGHT, KC_DOWN, KC_NONE, KC_NONE, KC_NONE, KC_NONE }
};
//Create an array that points to the various keymaps
uint16_t (*default_layouts[])[MATRIX_ROWS][KEYMAP_COLS] = { &_QWERTY, &_NUM,
&_PLUGINS
};
uint8_t current_layout = 0;
#endif