diff options
author | Jay Greco <jayv.greco@gmail.com> | 2021-02-09 06:50:16 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-09 14:50:16 +0000 |
commit | 4107856b70eb686d2e151254ca73adf522312c49 (patch) | |
tree | 81b52ea7b24328f7d7c7baaa328be126d06bef64 /keyboards/nullbitsco/nibble/keymaps/via/keymap.c | |
parent | 627ceebef3ed19eceba3642a830ffbf44f4a9e04 (diff) | |
download | qmk_firmware-4107856b70eb686d2e151254ca73adf522312c49.tar.gz qmk_firmware-4107856b70eb686d2e151254ca73adf522312c49.zip |
Simplify NIBBLE encoder code and clean up keymaps (#11808)
* Simplify encoder code and clean up keymaps.
-Removed overly complex VIA encoder code. It wasn't adding any value and was confusing users who were trying to customize encoder functionality on VIA keymaps.
-Replaced KC_TILDE with KC_HOME in all keymaps, as KC_TILDE sends a left shift, which was confusing some folks as they tested their build.
-Move layer names to enum
* Change encoder_update_kb to encoder_update_user per PR feedback
Diffstat (limited to 'keyboards/nullbitsco/nibble/keymaps/via/keymap.c')
-rw-r--r-- | keyboards/nullbitsco/nibble/keymaps/via/keymap.c | 30 |
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 f72ffc56e1..5b2f3b4f2e 100644 --- a/keyboards/nullbitsco/nibble/keymaps/via/keymap.c +++ b/keyboards/nullbitsco/nibble/keymaps/via/keymap.c @@ -14,12 +14,13 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include QMK_KEYBOARD_H -#include "via_extras.h" -#define _BASE 0 -#define _VIA1 1 -#define _VIA2 2 -#define _VIA3 3 +enum layer_names { + _BASE, + _VIA1, + _VIA2, + _VIA3 +}; #define KC_DISC_MUTE KC_F23 #define KC_DISC_DEAF KC_F24 @@ -50,7 +51,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_VIA1] = LAYOUT_all( - 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, + 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, RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -100,7 +101,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { tap_code(KC_DISC_MUTE); if (!rgblight_is_enabled()) break; - + if (muted) { rgblight_enable_noeeprom(); } else { @@ -133,7 +134,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!is_alt_tab_active) { is_alt_tab_active = true; register_code(KC_LALT); - } + } alt_tab_timer = timer_read(); register_code(KC_TAB); } else { @@ -142,11 +143,20 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; default: - break; + break; } return true; } +void encoder_update_user(uint8_t index, bool clockwise) { + // Encoder is mapped to volume functions by default + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } +} + void matrix_init_user(void) { // Initialize remote keyboard, if connected (see readme) matrix_init_remote_kb(); @@ -161,4 +171,4 @@ void matrix_scan_user(void) { is_alt_tab_active = false; } } -}
\ No newline at end of file +} |