aboutsummaryrefslogtreecommitdiff
path: root/keyboards/nullbitsco/nibble/keymaps/via/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/nullbitsco/nibble/keymaps/via/keymap.c')
-rw-r--r--keyboards/nullbitsco/nibble/keymaps/via/keymap.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/keyboards/nullbitsco/nibble/keymaps/via/keymap.c b/keyboards/nullbitsco/nibble/keymaps/via/keymap.c
index f72ffc56e..5b2f3b4f2 100644
--- a/keyboards/nullbitsco/nibble/keymaps/via/keymap.c
+++ b/keyboards/nullbitsco/nibble/keymaps/via/keymap.c
@@ -14,12 +14,13 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>. 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */ 15 */
16#include QMK_KEYBOARD_H 16#include QMK_KEYBOARD_H
17#include "via_extras.h"
18 17
19#define _BASE 0 18enum layer_names {
20#define _VIA1 1 19 _BASE,
21#define _VIA2 2 20 _VIA1,
22#define _VIA3 3 21 _VIA2,
22 _VIA3
23};
23 24
24#define KC_DISC_MUTE KC_F23 25#define KC_DISC_MUTE KC_F23
25#define KC_DISC_DEAF KC_F24 26#define KC_DISC_DEAF KC_F24
@@ -50,7 +51,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
50 ), 51 ),
51 52
52 [_VIA1] = LAYOUT_all( 53 [_VIA1] = LAYOUT_all(
53 RESET, 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_HOME, KC_INS, 54 RESET, 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_END,
54 RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, 55 RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
55 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, 56 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
56 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, 57 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
@@ -100,7 +101,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
100 if (record->event.pressed) { 101 if (record->event.pressed) {
101 tap_code(KC_DISC_MUTE); 102 tap_code(KC_DISC_MUTE);
102 if (!rgblight_is_enabled()) break; 103 if (!rgblight_is_enabled()) break;
103 104
104 if (muted) { 105 if (muted) {
105 rgblight_enable_noeeprom(); 106 rgblight_enable_noeeprom();
106 } else { 107 } else {
@@ -133,7 +134,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
133 if (!is_alt_tab_active) { 134 if (!is_alt_tab_active) {
134 is_alt_tab_active = true; 135 is_alt_tab_active = true;
135 register_code(KC_LALT); 136 register_code(KC_LALT);
136 } 137 }
137 alt_tab_timer = timer_read(); 138 alt_tab_timer = timer_read();
138 register_code(KC_TAB); 139 register_code(KC_TAB);
139 } else { 140 } else {
@@ -142,11 +143,20 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
142 break; 143 break;
143 144
144 default: 145 default:
145 break; 146 break;
146 } 147 }
147return true; 148return true;
148} 149}
149 150
151void encoder_update_user(uint8_t index, bool clockwise) {
152 // Encoder is mapped to volume functions by default
153 if (clockwise) {
154 tap_code(KC_VOLU);
155 } else {
156 tap_code(KC_VOLD);
157 }
158}
159
150void matrix_init_user(void) { 160void matrix_init_user(void) {
151 // Initialize remote keyboard, if connected (see readme) 161 // Initialize remote keyboard, if connected (see readme)
152 matrix_init_remote_kb(); 162 matrix_init_remote_kb();
@@ -161,4 +171,4 @@ void matrix_scan_user(void) {
161 is_alt_tab_active = false; 171 is_alt_tab_active = false;
162 } 172 }
163 } 173 }
164} \ No newline at end of file 174}