Skip to content

Commit

Permalink
Fix keyboards/keymaps for boolean encoder callback changes (#12985)
Browse files Browse the repository at this point in the history
  • Loading branch information
drashna authored May 28, 2021
1 parent 5386c4c commit b963049
Show file tree
Hide file tree
Showing 9 changed files with 231 additions and 228 deletions.
2 changes: 1 addition & 1 deletion keyboards/handwired/amigopunk/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
#ifdef ENCODER_ENABLE
bool encoder_update_user(uint8_t index, bool clockwise) {
if (index != 0)
return;
return false;

tap_code(clockwise ? KC_VOLU : KC_VOLD);
return true;
Expand Down
3 changes: 2 additions & 1 deletion keyboards/keyprez/corgi/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
};

void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
tap_code(clockwise ? KC_VOLU : KC_VOLD);
return true;
}
3 changes: 2 additions & 1 deletion keyboards/mechwild/mercutio/keymaps/jonavin/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

#ifdef ENCODER_ENABLE // Encoder Functionality
uint8_t selected_layer = 0;
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
#ifdef OLED_DRIVER_ENABLE
oled_clear();
oled_render();
Expand All @@ -81,6 +81,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
}
}
}
return true;
}
#endif

Expand Down
18 changes: 9 additions & 9 deletions keyboards/mechwild/murphpad/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_MUTE, KC_P4, KC_P5, KC_P6, KC_NO,
MO(_FN1), KC_P1, KC_P2, KC_P3, KC_PENT,
KC_BSPC, KC_P0, KC_NO, KC_PDOT, KC_NO,

KC_F5, KC_F6, KC_F7

),
[_FN1] = LAYOUT(
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
RGB_HUD, RGB_SPI, RGB_HUI, _______,
_______, RGB_RMOD, RGB_TOG, RGB_MOD, KC_NO,
_______, RGB_VAD, RGB_SPD, RGB_VAI, _______,
_______, RGB_SAD, KC_NO, RGB_SAI, KC_NO,

_______, _______, _______

),
Expand All @@ -56,7 +56,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, KC_NO,
_______, _______, _______, _______, _______,
_______, _______, _______, _______, KC_NO,

_______, _______, _______

),
Expand All @@ -67,14 +67,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, KC_NO,
_______, _______, _______, _______, _______,
_______, _______, _______, _______, KC_NO,

_______, _______, _______

)
};

#ifdef ENCODER_ENABLE
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
switch (index) {
case 0:
if (clockwise) {
Expand All @@ -84,7 +84,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
}
break;
}

return true;
}
#endif

Expand All @@ -109,7 +109,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
}

void oled_task_user(void) {
render_logo();
render_logo();
oled_set_cursor(0,6);

oled_write_ln_P(PSTR("Layer"), false);
Expand Down Expand Up @@ -137,4 +137,4 @@ void encoder_update_user(uint8_t index, bool clockwise) {
oled_write_ln_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false);
oled_write_ln_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false);
}
#endif
#endif
28 changes: 14 additions & 14 deletions keyboards/mechwild/murphpad/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_MUTE, KC_P4, KC_P5, KC_P6, KC_NO,
MO(_FN1), KC_P1, KC_P2, KC_P3, KC_PENT,
KC_BSPC, KC_P0, KC_NO, KC_PDOT, KC_NO,

_______, _______, _______

),
[_FN1] = LAYOUT(
_______, _______, _______, _______,
Expand All @@ -43,9 +43,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, RGB_RMOD, RGB_TOG, RGB_MOD, KC_NO,
_______, RGB_VAD, RGB_SPD, RGB_VAI, _______,
_______, RGB_SAD, KC_NO, RGB_SAI, KC_NO,

_______, _______, _______

),
[_FN2] = LAYOUT(
_______, _______, _______, _______,
Expand All @@ -54,25 +54,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, KC_NO,
_______, _______, _______, _______, _______,
_______, _______, _______, _______, KC_NO,

_______, _______, _______
),

),
[_FN3] = LAYOUT(
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______, KC_NO,
_______, _______, _______, _______, _______,
_______, _______, _______, _______, KC_NO,

_______, _______, _______
)

)
};

#ifdef ENCODER_ENABLE
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
switch (index) {
case 0:
if (clockwise) {
Expand All @@ -82,7 +82,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
}
break;
}

return true;
}
#endif

Expand All @@ -107,7 +107,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
}

void oled_task_user(void) {
render_logo();
render_logo();
oled_set_cursor(0,6);

oled_write_ln_P(PSTR("Layer"), false);
Expand Down Expand Up @@ -135,4 +135,4 @@ void encoder_update_user(uint8_t index, bool clockwise) {
oled_write_ln_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false);
oled_write_ln_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false);
}
#endif
#endif
40 changes: 19 additions & 21 deletions keyboards/minimacro5/keymaps/devdev/keymap.c
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/* Copyright 2020 Dane Evans
*
* This program 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 2 of the License, or
* (at your option) any later version.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/
*
* This program 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 2 of the License, or
* (at your option) any later version.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/
// MINI MACRO 5

#include QMK_KEYBOARD_H
Expand All @@ -31,11 +31,11 @@ enum tap_dances{
TD_TO_MEDIA,
TD_TO_MAIN,
TD_RESET_SLIDER

};


void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) { /* First encoder*/
switch(biton32(layer_state)){
case _MAIN:
Expand Down Expand Up @@ -75,6 +75,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
break;
}
}
return true;
}

//
Expand All @@ -95,8 +96,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //buttion closest
};

layer_state_t layer_state_set_user(layer_state_t state) {
if (layer_state_cmp(state, _MAIN)) // this one not working

if (layer_state_cmp(state, _MAIN)) // this one not working
rgblight_sethsv_at(HSV_GREEN, 0);
if (layer_state_cmp(state, _MEDIA))
rgblight_sethsv_at(HSV_RED, 0);
Expand All @@ -121,6 +122,3 @@ qk_tap_dance_action_t tap_dance_actions[] = {
[TD_TO_MAIN] = ACTION_TAP_DANCE_LAYER_MOVE(KC_MUTE, _MAIN),
[TD_RESET_SLIDER] = ACTION_TAP_DANCE_LAYER_MOVE(KC_0, _MAIN)
};



3 changes: 2 additions & 1 deletion keyboards/planck/thk/keymaps/thk/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {

bool encoder_mode = false;

void encoder_update(bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) { /* First encoder */
if (clockwise) {
#ifdef MOUSEKEY_ENABLE
Expand Down Expand Up @@ -210,6 +210,7 @@ void encoder_update(bool clockwise) {
}
}
}
return true;
}

void dip_switch_update_user(uint8_t index, bool active) {
Expand Down
Loading

0 comments on commit b963049

Please sign in to comment.