aboutsummaryrefslogtreecommitdiff
path: root/keyboards/splitkb/kyria/keymaps/gotham/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/splitkb/kyria/keymaps/gotham/keymap.c')
-rw-r--r--keyboards/splitkb/kyria/keymaps/gotham/keymap.c127
1 files changed, 127 insertions, 0 deletions
diff --git a/keyboards/splitkb/kyria/keymaps/gotham/keymap.c b/keyboards/splitkb/kyria/keymaps/gotham/keymap.c
new file mode 100644
index 000000000..a725e61fe
--- /dev/null
+++ b/keyboards/splitkb/kyria/keymaps/gotham/keymap.c
@@ -0,0 +1,127 @@
1/* Copyright 2019 Thomas Baart <thomas@splitkb.com>
2 *
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.
7 *
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.
12 *
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/>.
15 */
16
17#include QMK_KEYBOARD_H
18
19#include "keycodes.h"
20
21#ifdef ENCODER_ENABLE
22# include "encoder_utils.h"
23#endif
24
25#ifdef OLED_DRIVER_ENABLE
26# include "oled_utils.h"
27#endif
28
29#ifdef THUMBSTICK_ENABLE
30# include "thumbstick.h"
31#endif
32
33// clang-format off
34const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
35/*
36 * Base Layer: QWERTY
37*/
38 [_QWERTY] = LAYOUT(
39 ESC_RAISE, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, BSLS_RAISE,
40 KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, SFT_QUOT,
41 KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LGUI, KC_NO, TMB_MODE, KC_NO, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, CTL_MINS,
42 ENC_MODE_L, KC_LALT, LT(_LOWER, KC_SPC), LT(_RAISE, KC_TAB), KC_LSFT, KC_EQL, LT(_RAISE, KC_ENT), LT(_LOWER, KC_BSPC), KC_DEL, ENC_MODE_R
43 ),
44/*
45 * Lower Layer: Symbols, Navigation
46 */
47 [_LOWER] = LAYOUT(
48 _______, KC_HASH, KC_DLR, KC_LCBR, KC_RCBR, KC_PIPE, _______, _______, _______, _______, _______, KC_PIPE,
49 _______, KC_EXLM, KC_AT, KC_LPRN, KC_RPRN, KC_GRV, KC_PGUP, KC_LEFT, KC_UP, KC_RGHT, _______, KC_QUOT,
50 _______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, _______, _______, _______, _______, KC_PGDN, KC_HOME, KC_DOWN, KC_END, _______, KC_MINS,
51 _______, _______, _______, KC_SCLN, KC_EQL, KC_EQL, KC_SCLN, _______, _______, _______
52 ),
53/*
54 * Raise Layer: Number keys, media, more symbols
55 */
56 [_RAISE] = LAYOUT(
57 _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
58 _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLU, KC_MINS, KC_PLUS, KC_ASTR, KC_SLSH, KC_PERC, _______,
59 _______, _______, _______, _______, KC_MUTE, KC_VOLD, _______, _______, _______, _______, KC_AMPR, KC_PIPE, KC_COMM, KC_DOT, KC_SLSH, _______,
60 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
61 ),
62/*
63 * Adjust Layer: Function keys, RGB
64 */
65 [_ADJUST] = LAYOUT(
66 _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______,
67 _______, RGB_TOG, RGB_SAI, RGB_HUI, RGB_VAI, RGB_MOD, _______, _______, _______, KC_F11, KC_F12, _______,
68 _______, _______, RGB_SAD, RGB_HUD, RGB_VAD, RGB_RMOD,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
69 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
70 ),
71};
72// clang-format on
73
74void matrix_init_user(void) {
75#ifdef ENCODER_ENABLE
76 encoder_utils_init();
77#endif
78}
79
80layer_state_t layer_state_set_user(layer_state_t state) { return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); }
81
82bool process_record_user(uint16_t keycode, keyrecord_t *record) {
83 switch (keycode) {
84#ifdef ENCODER_ENABLE
85 case ENC_MODE_L:
86 if (record->event.pressed) {
87 cycle_encoder_mode(true, false);
88 }
89 break;
90 case ENC_MODE_R:
91 if (record->event.pressed) {
92 cycle_encoder_mode(false, false);
93 }
94 break;
95#endif
96#ifdef THUMBSTICK_ENABLE
97 case TMB_MODE:
98 if (record->event.pressed) {
99 thumbstick_mode_cycle(false);
100 }
101#endif
102 }
103 return true;
104}
105
106#ifdef OLED_DRIVER_ENABLE
107oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_180; }
108
109void oled_task_user(void) { render_status(); }
110#endif
111
112#ifdef ENCODER_ENABLE
113bool encoder_update_user(uint8_t index, bool clockwise) {
114 if (index == 0) {
115 encoder_action(get_encoder_mode(true), clockwise);
116# ifdef OLED_DRIVER_ENABLE
117 oled_on();
118# endif
119 } else if (index == 1) {
120 encoder_action(get_encoder_mode(false), clockwise);
121# ifdef OLED_DRIVER_ENABLE
122 oled_on();
123# endif
124 }
125 return true;
126}
127#endif