From c417a2470ca9657f57e63c1199bba19ac10087f8 Mon Sep 17 00:00:00 2001 From: Aidan Smith Date: Wed, 22 Feb 2023 01:54:09 -0500 Subject: [PATCH] first pass on encoder map. Not functioning whatsoever --- keyboards/aidansmithdotdev/fine40/fine40.c | 15 --------------- .../fine40/keymaps/default/keymap.c | 9 +++++++++ .../aidansmithdotdev/fine40/keymaps/via/keymap.c | 9 +++++++++ keyboards/aidansmithdotdev/fine40/rules.mk | 1 + 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/keyboards/aidansmithdotdev/fine40/fine40.c b/keyboards/aidansmithdotdev/fine40/fine40.c index cc4024136ebd..19d404d5a18b 100644 --- a/keyboards/aidansmithdotdev/fine40/fine40.c +++ b/keyboards/aidansmithdotdev/fine40/fine40.c @@ -67,19 +67,4 @@ bool oled_task_kb(void) { //render_logo(); return(true); } -#endif - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { - return false; - } - // Volume control - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - return false; -} #endif \ No newline at end of file diff --git a/keyboards/aidansmithdotdev/fine40/keymaps/default/keymap.c b/keyboards/aidansmithdotdev/fine40/keymaps/default/keymap.c index d157d9db31b4..69b9dacd274f 100644 --- a/keyboards/aidansmithdotdev/fine40/keymaps/default/keymap.c +++ b/keyboards/aidansmithdotdev/fine40/keymaps/default/keymap.c @@ -41,3 +41,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______ , _______ , _______ , _______ , _______ , _______ , _______ , KC_MS_L , KC_MS_D , KC_MS_U , KC_MS_R , _______ ), }; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [_MAIN] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_LEFT] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_RIGHT] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_TAB] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, +}; +#endif \ No newline at end of file diff --git a/keyboards/aidansmithdotdev/fine40/keymaps/via/keymap.c b/keyboards/aidansmithdotdev/fine40/keymaps/via/keymap.c index d157d9db31b4..69b9dacd274f 100644 --- a/keyboards/aidansmithdotdev/fine40/keymaps/via/keymap.c +++ b/keyboards/aidansmithdotdev/fine40/keymaps/via/keymap.c @@ -41,3 +41,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______ , _______ , _______ , _______ , _______ , _______ , _______ , KC_MS_L , KC_MS_D , KC_MS_U , KC_MS_R , _______ ), }; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [_MAIN] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_LEFT] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_RIGHT] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_TAB] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, +}; +#endif \ No newline at end of file diff --git a/keyboards/aidansmithdotdev/fine40/rules.mk b/keyboards/aidansmithdotdev/fine40/rules.mk index 2e3ef9fb844d..201d65d4688e 100644 --- a/keyboards/aidansmithdotdev/fine40/rules.mk +++ b/keyboards/aidansmithdotdev/fine40/rules.mk @@ -1 +1,2 @@ OLED_DRIVER = SSD1306 +ENCODER_MAP_ENABLE = yes