diff --git a/keyboards/bluebell/swoop/keymaps/t4corun/keymap.c b/keyboards/bluebell/swoop/keymaps/t4corun/keymap.c index 632ceb31..69c9e654 100644 --- a/keyboards/bluebell/swoop/keymaps/t4corun/keymap.c +++ b/keyboards/bluebell/swoop/keymaps/t4corun/keymap.c @@ -22,12 +22,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_DEFAULT_LAYER_1 ] = SWOOP(LAYER_QWERTY), [_DEFAULT_LAYER_2 ] = SWOOP(LAYER_COLEMAK_DH), [_DEFAULT_LAYER_3 ] = SWOOP(LAYER_GAME), - [_NAVIGATION] = SWOOP(LAYER_NAVIGATION), - [_NUMBER] = SWOOP(LAYER_NUMBER), - [_SYMBOL] = SWOOP(LAYER_SYMBOL), - [_FUNCTION] = SWOOP(LAYER_FUNCTION), - [_MOUSE] = SWOOP(LAYER_MOUSE), - [_GAME_NUM] = SWOOP(LAYER_GAME_NUM), - [_CONFIG] = SWOOP(LAYER_CONFIG) + [_NAVIGATION] = SWOOP(LAYER_NAVIGATION), + [_NUMBER] = SWOOP(LAYER_NUMBER), + [_SYMBOL] = SWOOP(LAYER_SYMBOL), + [_FUNCTION] = SWOOP(LAYER_FUNCTION), + [_MOUSE] = SWOOP(LAYER_MOUSE), + [_GAME_NUM] = SWOOP(LAYER_GAME_NUM), + [_CONFIG] = SWOOP(LAYER_CONFIG) }; \ No newline at end of file diff --git a/keyboards/bluebell/swoop/keymaps/t4corun/rules.mk b/keyboards/bluebell/swoop/keymaps/t4corun/rules.mk index a7d60f6d..1088abef 100644 --- a/keyboards/bluebell/swoop/keymaps/t4corun/rules.mk +++ b/keyboards/bluebell/swoop/keymaps/t4corun/rules.mk @@ -2,4 +2,5 @@ # override keyboard defaults # qmk_firmware\keyboards\bluebell\swoop\rules.mk -CONVERT_TO=blok \ No newline at end of file +ENCODER_MAP_ENABLE = yes +CONVERT_TO = blok \ No newline at end of file diff --git a/users/t4corun/features/encoder.c b/users/t4corun/features/encoder.c new file mode 100644 index 00000000..932a2ef1 --- /dev/null +++ b/users/t4corun/features/encoder.c @@ -0,0 +1,16 @@ +#include "encoder.h" + + +/* may have to swap the hands in this array since we do right side master*/ +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [_DEFAULT_LAYER_1 ] = { ENCODER_CCW_CW(TR_MWHU, TR_MWHD), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, //wheel up, wheel down, vol up and down + [_DEFAULT_LAYER_2 ] = { ENCODER_CCW_CW(TR_MWHU, TR_MWHD), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, //wheel up, wheel down, vol up and down + [_DEFAULT_LAYER_3 ] = { ENCODER_CCW_CW(TR_MWHU, TR_MWHD), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, //wheel up, wheel down, xx,xx + [_NAVIGATION] = { ENCODER_CCW_CW(TR_MWHU, TR_MWHD), ENCODER_CCW_CW(___x___, ___x___) }, //wheel up, wheel down, xx,xx + [_NUMBER] = { ENCODER_CCW_CW(___x___, ___x___), ENCODER_CCW_CW(KC_LEFT, KC_RGHT) }, //xx,xx left and right + [_SYMBOL] = { ENCODER_CCW_CW(___x___, ___x___), ENCODER_CCW_CW(___x___, ___x___) }, //xx,xx xx,xx + [_FUNCTION] = { ENCODER_CCW_CW(___x___, ___x___), ENCODER_CCW_CW(KC_UP, KC_DOWN) }, //xx,xx up and down + [_MOUSE] = { ENCODER_CCW_CW(TR_MWHU, TR_MWHD), ENCODER_CCW_CW(___x___, ___x___) }, //wheel up, wheel down, ??,?? + [_GAME_NUM] = { ENCODER_CCW_CW(TR_MWHU, TR_MWHD), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, //wheel up, wheel down, xx,xx + [_CONFIG] = { ENCODER_CCW_CW(TR_MWHU, TR_MWHD), ENCODER_CCW_CW(___x___, ___x___) }, //maybe rgb functionality? +}; \ No newline at end of file diff --git a/users/t4corun/features/encoder.h b/users/t4corun/features/encoder.h new file mode 100644 index 00000000..2a576cc3 --- /dev/null +++ b/users/t4corun/features/encoder.h @@ -0,0 +1,2 @@ +#pragma once +#include "t4corun.h" \ No newline at end of file diff --git a/users/t4corun/features/oled.c b/users/t4corun/features/oled.c index 6c7ad583..c90dee5c 100644 --- a/users/t4corun/features/oled.c +++ b/users/t4corun/features/oled.c @@ -99,7 +99,8 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) { if (is_keyboard_master()) { return OLED_ROTATION_270; } else { - return OLED_ROTATION_270; + return OLED_ROTATION_90; } } +a \ No newline at end of file diff --git a/users/t4corun/rules.mk b/users/t4corun/rules.mk index 2a2c0487..de74299a 100644 --- a/users/t4corun/rules.mk +++ b/users/t4corun/rules.mk @@ -22,6 +22,7 @@ RGB_MATRIX_ENABLE ?= no RGBLIGHT_ENABLE ?= no POINTING_DEVICE_ENABLE ?= no OLED_ENABLE ?= no +ENCODER_MAP_ENABLE ?= no # qmk features we will force AUDIO_ENABLE = no @@ -59,6 +60,9 @@ ifeq ($(strip $(OLED_ENABLE)), yes) SRC += features/oled.c endif +ifeq ($(strip $(ENCODER_MAP_ENABLE)), yes) + SRC += features/encoders.c +endif ifeq ($(strip $(COMBO_ENABLE)), yes) INTROSPECTION_KEYMAP_C += features/combo.c diff --git a/users/t4corun/t4corun.c b/users/t4corun/t4corun.c index 81542922..ab3d0106 100644 --- a/users/t4corun/t4corun.c +++ b/users/t4corun/t4corun.c @@ -1,5 +1,7 @@ #include "t4corun.h" +static uint8_t current_base_layer = _DEFAULT_LAYER_1; + layer_state_t layer_state_set_user(layer_state_t state) { state = update_tri_layer_state(state, _NAVIGATION, _NUMBER, _SYMBOL); @@ -10,7 +12,15 @@ layer_state_t layer_state_set_user(layer_state_t state) { bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { + + case BASELYR: + if (record->event.pressed) { + current_base_layer = (current_base_layer + 1) % NUM_BASE_LAYER; + set_single_persistent_default_layer(current_base_layer); + } + return false + /* case QWERTY: if (record->event.pressed) { set_single_persistent_default_layer(_QWERTY); } //default_layer_set(1UL<<_QWERTY); } return false; @@ -22,6 +32,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case GAME: if (record->event.pressed) { set_single_persistent_default_layer(_GAME); } //default_layer_set(1UL<<_COLEMAK_DH); } return false; + */ case PN_DRGS: if (record->event.pressed) { diff --git a/users/t4corun/t4corun.h b/users/t4corun/t4corun.h index 984f99b7..b9e1b7b9 100644 --- a/users/t4corun/t4corun.h +++ b/users/t4corun/t4corun.h @@ -39,7 +39,9 @@ enum keycodes { TH_QUOT, PN_DRGS, - PN_PDPI + PN_PDPI, + + BASELYR }; #define ___x___ KC_NO @@ -186,15 +188,10 @@ enum keycodes { - - - - - - #define _DEFAULT_LAYER_1 FIRST_DEFAULT_LAYER #define _DEFAULT_LAYER_2 (FIRST_DEFAULT_LAYER + 1) #define _DEFAULT_LAYER_3 (FIRST_DEFAULT_LAYER + 2) +#define NUM_BASE_LAYER 3 #define _NONE_3__________________ ___x___, ___x___, ___x___ #define _NONE_5____________________________________ ___x___, ___x___, ___x___, ___x___, ___x___ @@ -283,6 +280,6 @@ enum keycodes { #define LAYER_CONFIG \ ___x___, ___x___, ___x___, ___x___, ___x___, EE_CLR, QK_RBT, QK_BOOT, ___x___, _______, \ - TR_RTOG, TR_RMOD, ___x___, ___x___, ___x___, ___x___, _SCAG_MODS________________________, \ - TR_RHUI, TR_RSAI, TR_RVAI, TR_RSPI, GAME, _NONE_5____________________________________, \ - CLMAKDH, QWERTY, _LAYER_TRANS_R__ + TR_RTOG, TR_RMOD, ___x___, ___x___, ___x___, BASELYR, _SCAG_MODS________________________, \ + TR_RHUI, TR_RSAI, TR_RVAI, TR_RSPI, ___x___, _NONE_5____________________________________, \ + ___x___, ___x___, _LAYER_TRANS_R__