summaryrefslogtreecommitdiff
path: root/keyboards/sol/keymaps/brianweyer/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/sol/keymaps/brianweyer/keymap.c')
-rwxr-xr-xkeyboards/sol/keymaps/brianweyer/keymap.c36
1 files changed, 26 insertions, 10 deletions
diff --git a/keyboards/sol/keymaps/brianweyer/keymap.c b/keyboards/sol/keymaps/brianweyer/keymap.c
index 87d603d817..3ba52081d2 100755
--- a/keyboards/sol/keymaps/brianweyer/keymap.c
+++ b/keyboards/sol/keymaps/brianweyer/keymap.c
@@ -11,8 +11,6 @@ extern keymap_config_t keymap_config;
extern rgblight_config_t rgblight_config;
#endif
-extern uint8_t is_master;
-
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
@@ -59,8 +57,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------|
LCTL, LALT, FN, LGUI, RGB_MOD, SPC, DEL, BSPC, SPC, ADJ, LGUI, FN, LALT, LCTL,
//|--------+--------+--------+--------+--------+--+--------+--------| |--------+--+--------+--------+--------+--------+--------+--------|
- VOLD, VOLU, SPC, ENT, ENT, SPC, DOWN, UP
- // Rotary Left |--------+--------| |--------+-----------+ Rotary Right
+ SPC, ENT, ENT, SPC
+ // |--------+--------| |--------+-----------+
),
/* FN
@@ -90,8 +88,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
//|--------+--------+--------+--------+--------+--+--------+--------| |--------+--+--------+--------+--------+--------+--------+--------|
- VOLD, VOLU, _______, _______, _______, _______, UP, DOWN
- // Rotary Left |--------+--------| |--------+-----------+ Rotary Right
+ _______, _______, _______, _______
+ // |--------+--------| |--------+-----------+
),
/* ADJ
@@ -122,8 +120,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
//|--------+--------+--------+--------+--------+--+--------+--------| |--------+--------+--+--------+--------+--------+--------+--------|
- _______, _______, _______, _______, _______, _______, _______, _______ \
- // Rotary Left |--------+--------| |--------+--------+ Rotary Right
+ _______, _______, _______, _______ \
+ // |--------+--------| |--------+--------+
)
};
@@ -132,6 +130,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
bool TOG_STATUS = false;
int RGB_current_mode;
+#ifdef ENCODER_ENABLE
+void encoder_update_user(uint8_t index, bool clockwise) {
+ if (index == 0) { /* First encoder */
+ if (clockwise) {
+ tap_code(KC_VOLU);
+ } else {
+ tap_code(KC_VOLD);
+ }
+ } else if (index == 1) { /* Second encoder*/
+ if (clockwise) {
+ tap_code(KC_UP);
+ } else {
+ tap_code(KC_DOWN);
+ }
+ }
+}
+#endif
+
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
@@ -182,7 +198,7 @@ void matrix_init_user(void) {
#ifdef OLED_DRIVER_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
- if (!has_usb())
+ if (!is_keyboard_master())
return OLED_ROTATION_180; // flip 180 for offhand
return rotation;
}
@@ -244,7 +260,7 @@ static void render_status(void) {
}
void oled_task_user(void) {
- if (is_master)
+ if (is_keyboard_master())
render_status();
else
render_logo();