Bandominedoni encoder fix (#18229)

by 3araht
This commit is contained in:
3araht 2022-09-01 02:17:54 +09:00 committed by GitHub
parent 0faedb11cc
commit 786b5d310d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 76 additions and 90 deletions

View file

@ -117,55 +117,3 @@ static enum { UNKNOWN, LEFT, RIGHT } hand_side = UNKNOWN;
return (hand_side == LEFT);
}
}
#ifdef ENCODER_ENABLE
# ifdef ENCODERS
static uint8_t encoder_state[ENCODERS] = {0};
static keypos_t encoder_cw[ENCODERS] = ENCODERS_CW_KEY;
static keypos_t encoder_ccw[ENCODERS] = ENCODERS_CCW_KEY;
# endif
void encoder_action_unregister(void) {
# ifdef ENCODERS
for (int index = 0; index < ENCODERS; ++index) {
if (encoder_state[index]) {
keyevent_t encoder_event = (keyevent_t) {
.key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index],
.pressed = false,
.time = (timer_read() | 1)
};
encoder_state[index] = 0;
action_exec(encoder_event);
}
}
# endif
}
void encoder_action_register(uint8_t index, bool clockwise) {
# ifdef ENCODERS
keyevent_t encoder_event = (keyevent_t) {
.key = clockwise ? encoder_cw[index] : encoder_ccw[index],
.pressed = true,
.time = (timer_read() | 1)
};
encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
# ifdef CONSOLE_ENABLE
uprintf("encoder_action_register index = %u, clockwise = %u, row = %u, col = %u\n", index, clockwise, encoder_event.key.row, encoder_event.key.col);
# endif
action_exec(encoder_event);
# endif
}
void matrix_scan_kb(void) {
encoder_action_unregister();
matrix_scan_user();
}
bool encoder_update_kb(uint8_t index, bool clockwise) {
encoder_action_register(index, clockwise);
// don't return user actions, because they are in the keymap
// encoder_update_user(index, clockwise);
return true;
};
#endif

View file

@ -38,7 +38,7 @@
l40, l41, l42, l43, l44, l45, l46, l47, \
\
oc, r00, r01, r02, r03, fn, \
r10, r11, r12, r13, r14, ccw, cw,\
r10, r11, r12, r13, r14, \
r20, r21, r22, r23, r24, r25, \
r30, r31, r32, r33, r34, r35, r36, r37, \
r40, r41, r42, r43, r44, r45, r46, r47, \
@ -49,7 +49,7 @@
{ l20, l21, l22, l23, l24, l25, l26 }, \
{ l30, l31, l32, l33, l34, l35, l36 }, \
{ l41, l42, l43, l44, l45, l46, l47 }, \
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, ccw, cw }, \
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
{ r50, r40, r31, r20, r10, r00, r30 }, \
{ r51, r41, r32, r21, r11, r01, oc }, \
{ r52, r42, r33, r22, r12, r02, fn }, \
@ -83,6 +83,3 @@
// However, It enables to decide the handedness by the HW by adding one condition: "not to press any keys (especially r30) dusing startup."
bool is_keyboard_left(void);
void encoder_action_unregister(void);
void encoder_action_register(uint8_t index, bool clockwise);

View file

@ -248,13 +248,11 @@
* Encoder options
*/
#ifdef ENCODER_ENABLE
# define ENCODERS_PAD_A { C7 } // dummy
# define ENCODERS_PAD_B { B7 } // dummy
# define ENCODERS_PAD_A { }
# define ENCODERS_PAD_B { }
# define ENCODER_RESOLUTIONS { }
# define ENCODERS_PAD_A_RIGHT { F5 }
# define ENCODERS_PAD_B_RIGHT { F4 }
# define ENCODER_RESOLUTION 4
# define ENCODER_RESOLUTIONS_RIGHT { 4 }
# define TAP_CODE_DELAY 10
# define ENCODERS 2
# define ENCODERS_CW_KEY { {4, 5}, {6, 5} }
# define ENCODERS_CCW_KEY { {3, 5}, {5, 5} }
#endif // ENCODER_ENABLE

View file

@ -65,9 +65,6 @@
{"label": "r13", "x": 14, "y": 1},
{"label": "r14", "x": 15, "y": 1},
{"label": "ccw", "x": 16.5, "y": 1},
{"label": "cw", "x": 17.5, "y": 1},
{"label": "r20", "x": 10.5, "y": 2},
{"label": "r21", "x": 11.5, "y": 2},
{"label": "r22", "x": 12.5, "y": 2},

View file

@ -41,7 +41,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
MI_D_1, MI_B_1, MI_G_3, MI_A_3, MI_Ds_3, MI_Fs_2, MI_Ds_1, MI_C_1,
MO_SWAP, MI_B_5, MI_Gs_5, MI_G_5, MI_F_5, FN_MUTE,
MI_Cs_3, MI_A_5, MI_Fs_5, MI_E_5, MI_Ds_5, KC_VOLD, KC_VOLU,
MI_Cs_3, MI_A_5, MI_Fs_5, MI_E_5, MI_Ds_5,
MI_C_3, MI_D_3, MI_G_3, MI_As_4, MI_C_5, MI_D_5,
TG_SWAP, MI_B_2, MI_E_3, MI_Cs_4, MI_Fs_3, MI_A_3, MI_C_4, MI_E_4,
MI_A_2, MI_F_3, MI_As_3, MI_Gs_3, MI_B_3, MI_D_4, MI_Gs_4, MI_B_4,
@ -56,7 +56,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
MI_E_1, MI_E_2, MI_Fs_3, MI_Gs_3, MI_B_3, MI_F_2, MI_Cs_1, MI_F_1,
MO_SWAP, MI_A_5, MI_Gs_5, MI_Fs_5, MI_F_5, FN_MUTE,
MI_C_3, MI_G_5, MI_As_4, MI_C_5, MI_Ds_5, KC_VOLD, KC_VOLU,
MI_C_3, MI_G_5, MI_As_4, MI_C_5, MI_Ds_5,
MI_D_3, MI_Cs_3, MI_Gs_3, MI_As_3, MI_C_4, MI_D_5,
TG_SWAP, MI_B_2, MI_Fs_3, MI_Fs_4, MI_G_3, MI_B_3, MI_D_4, MI_G_4,
MI_A_2, MI_F_3, MI_E_3, MI_A_3, MI_Cs_4, MI_E_4, MI_A_4, MI_Cs_5,
@ -71,7 +71,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, MI_OCTD, MI_OCTU, MI_VELD, MI_VELU, _______,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, VERSION,
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
@ -79,6 +79,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
[_OPEN] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[_CLOSE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[_FN] = { ENCODER_CCW_CW(_______, _______) },
};
#endif
void keyboard_post_init_user(void) {
// Set octave to MI_OCT_0
midi_config.octave = MI_OCT_0 - MIDI_OCTAVE_MIN;

View file

@ -0,0 +1 @@
ENCODER_MAP_ENABLE = yes # replacing ENCODERS_CW_KEY method to this on 2022/08/31.

View file

@ -71,7 +71,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
MI_D_1, MI_B_1, MI_G_3, MI_A_3, MI_Ds_3, MI_Fs_2, MI_Ds_1, MI_C_1,
MO_SWAP, MI_B_5, MI_Gs_5, MI_G_5, MI_F_5, FN_MUTE,
MI_Cs_3, MI_A_5, MI_Fs_5, MI_E_5, MI_Ds_5, KC_VOLD, KC_VOLU,
MI_Cs_3, MI_A_5, MI_Fs_5, MI_E_5, MI_Ds_5,
MI_C_3, MI_D_3, MI_G_3, MI_As_4, MI_C_5, MI_D_5,
TG_SWAP, MI_B_2, MI_E_3, MI_Cs_4, MI_Fs_3, MI_A_3, MI_C_4, MI_E_4,
MI_A_2, MI_F_3, MI_As_3, MI_Gs_3, MI_B_3, MI_D_4, MI_Gs_4, MI_B_4,
@ -86,7 +86,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
MI_E_1, MI_E_2, MI_Fs_3, MI_Gs_3, MI_B_3, MI_F_2, MI_Cs_1, MI_F_1,
MO_SWAP, MI_A_5, MI_Gs_5, MI_Fs_5, MI_F_5, FN_MUTE,
MI_C_3, MI_G_5, MI_As_4, MI_C_5, MI_Ds_5, KC_VOLD, KC_VOLU,
MI_C_3, MI_G_5, MI_As_4, MI_C_5, MI_Ds_5,
MI_D_3, MI_Cs_3, MI_Gs_3, MI_As_3, MI_C_4, MI_D_5,
TG_SWAP, MI_B_2, MI_Fs_3, MI_Fs_4, MI_G_3, MI_B_3, MI_D_4, MI_G_4,
MI_A_2, MI_F_3, MI_E_3, MI_A_3, MI_Cs_4, MI_E_4, MI_A_4, MI_Cs_5,
@ -101,7 +101,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCTL, KC_GRV, KC_LGUI, KC_LALT, MIS_EIS, KC_SPC, KC_SPC, KC_PSCR,
MO(_MISC), KC_LBRC, KC_RBRC, KC_BSLS, KC_0, _______,
KC_6, KC_7, KC_8, KC_9, KC_BSPC, _______, _______,
KC_6, KC_7, KC_8, KC_9, KC_BSPC,
_________________QWERTY_R1_________________, KC_DEL,
KC_PGUP, KC_G, _________________QWERTY_R2_________________, KC_ENT,
KC_PGDN, KC_B, _________________QWERTY_R3_________________, KC_RSFT,
@ -116,7 +116,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_CAPS, KC_GRV, KC_LGUI, KC_LALT, MIS_EIS, KC_SPC, KC_SPC, KC_PSCR,
MO(_MISC), KC_LBRC, KC_RBRC, KC_BSLS, KC_0, _______,
KC_6, KC_7, KC_8, KC_9, KC_BSPC, _______, _______,
KC_6, KC_7, KC_8, KC_9, KC_BSPC,
_________________COLEMAK_R1________________, KC_DEL,
KC_PGUP, KC_D, _________________COLEMAK_R2________________, KC_ENT,
KC_PGDN, KC_B, _________________COLEMAK_R3________________, KC_RSFT,
@ -131,7 +131,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, KC_F10, _______,
KC_F6, KC_F7, KC_F8, KC_F9, _______, _______, _______,
KC_F6, KC_F7, KC_F8, KC_F9, _______,
_______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, KC_QUOT, _______,
_______, _______, _______, _______, _______, _______, _______, _______,
@ -146,7 +146,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
XXXXXXX, XXXXXXX, AG_NORM, AG_SWAP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, MI_OCTD, MI_OCTU, MI_VELD, MI_VELU, _______,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_RMOD, RGB_MOD,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, VERSION,
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
RGB_SAD, RGB_SAI, RGB_HUD, RGB_HUI, RGB_SPD, RGB_SPI, RGB_VAD, RGB_VAI,
@ -154,6 +154,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
[_OPEN] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[_CLOSE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[_QWERTY] = { ENCODER_CCW_CW(_______, _______) },
[_COLEMAK] = { ENCODER_CCW_CW(_______, _______) },
[_MISC] = { ENCODER_CCW_CW(_______, _______) },
[_FN] = { ENCODER_CCW_CW(RGB_RMOD, RGB_MOD) },
};
#endif
void my_init(void){
// Set octave to MI_OCT_0
midi_config.octave = MI_OCT_0 - MIDI_OCTAVE_MIN;

View file

@ -1,2 +1,4 @@
RGB_MATRIX_ENABLE = yes # Use RGB matrix (Don't enable this when RGBLIGHT_ENABLE is used.)
RGB_MATRIX_CUSTOM_KB = yes #
ENCODER_MAP_ENABLE = yes # replacing ENCODERS_CW_KEY method to this on 2022/08/31.

View file

@ -71,7 +71,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
MI_D_1, MI_B_1, MI_G_3, MI_A_3, MI_Ds_3, MI_Fs_2, MI_Ds_1, MI_C_1,
MO_SWAP, MI_B_5, MI_Gs_5, MI_G_5, MI_F_5, FN_MUTE,
MI_Cs_3, MI_A_5, MI_Fs_5, MI_E_5, MI_Ds_5, KC_VOLD, KC_VOLU,
MI_Cs_3, MI_A_5, MI_Fs_5, MI_E_5, MI_Ds_5,
MI_C_3, MI_D_3, MI_G_3, MI_As_4, MI_C_5, MI_D_5,
MI_G_2, MI_B_2, MI_E_3, MI_Cs_4, MI_Fs_3, MI_A_3, MI_C_4, MI_E_4,
MI_A_2, MI_F_3, MI_As_3, MI_Gs_3, MI_B_3, MI_D_4, MI_Gs_4, MI_B_4,
@ -86,7 +86,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
MI_E_1, MI_E_2, MI_Fs_3, MI_Gs_3, MI_B_3, MI_F_2, MI_Cs_1, MI_F_1,
MO_SWAP, MI_A_5, MI_Gs_5, MI_Fs_5, MI_F_5, FN_MUTE,
MI_C_3, MI_G_5, MI_As_4, MI_C_5, MI_Ds_5, KC_VOLD, KC_VOLU,
MI_C_3, MI_G_5, MI_As_4, MI_C_5, MI_Ds_5,
MI_D_3, MI_Cs_3, MI_Gs_3, MI_As_3, MI_C_4, MI_D_5,
MI_G_2, MI_B_2, MI_Fs_3, MI_Fs_4, MI_G_3, MI_B_3, MI_D_4, MI_G_4,
MI_A_2, MI_F_3, MI_E_3, MI_A_3, MI_Cs_4, MI_E_4, MI_A_4, MI_Cs_5,
@ -101,7 +101,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCTL, KC_GRV, KC_LGUI, KC_LALT, MIS_EIS, KC_SPC, KC_SPC, KC_PSCR,
MO(_MISC), KC_LBRC, KC_RBRC, KC_BSLS, KC_0, _______,
KC_6, KC_7, KC_8, KC_9, KC_BSPC, _______, _______,
KC_6, KC_7, KC_8, KC_9, KC_BSPC,
_________________QWERTY_R1_________________, KC_DEL,
KC_PGUP, KC_G, _________________QWERTY_R2_________________, KC_ENT,
KC_PGDN, KC_B, _________________QWERTY_R3_________________, KC_RSFT,
@ -116,7 +116,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_CAPS, KC_GRV, KC_LGUI, KC_LALT, MIS_EIS, KC_SPC, KC_SPC, KC_PSCR,
MO(_MISC), KC_LBRC, KC_RBRC, KC_BSLS, KC_0, _______,
KC_6, KC_7, KC_8, KC_9, KC_BSPC, _______, _______,
KC_6, KC_7, KC_8, KC_9, KC_BSPC,
_________________COLEMAK_R1________________, KC_DEL,
KC_PGUP, KC_D, _________________COLEMAK_R2________________, KC_ENT,
KC_PGDN, KC_B, _________________COLEMAK_R3________________, KC_RSFT,
@ -131,7 +131,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, KC_F10, _______,
KC_F6, KC_F7, KC_F8, KC_F9, _______, _______, _______,
KC_F6, KC_F7, KC_F8, KC_F9, _______,
_______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, KC_QUOT, _______,
_______, _______, _______, _______, _______, _______, _______, _______,
@ -145,8 +145,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, AG_NORM, AG_SWAP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, MI_OCTD, MI_OCTU, MI_VELD, MI_VELU, _______,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_RMOD, RGB_MOD,
_______, KC_VOLD, KC_VOLU, MI_VELD, MI_VELU, _______,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, VERSION,
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
RGB_SAD, RGB_SAI, RGB_HUD, RGB_HUI, RGB_SPD, RGB_SPI, RGB_VAD, RGB_VAI,
@ -154,6 +154,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
[_OPEN] = { ENCODER_CCW_CW(MI_OCTD, MI_OCTU) },
[_CLOSE] = { ENCODER_CCW_CW(MI_OCTD, MI_OCTU) },
[_QWERTY] = { ENCODER_CCW_CW(_______, _______) },
[_COLEMAK] = { ENCODER_CCW_CW(_______, _______) },
[_MISC] = { ENCODER_CCW_CW(_______, _______) },
[_FN] = { ENCODER_CCW_CW(RGB_RMOD, RGB_MOD) },
};
#endif
void my_init(void){
// Set octave to MI_OCT_0
midi_config.octave = MI_OCT_0 - MIDI_OCTAVE_MIN;

View file

@ -1,2 +1,4 @@
RGB_MATRIX_ENABLE = yes # Use RGB matrix (Don't enable this when RGBLIGHT_ENABLE is used.)
RGB_MATRIX_CUSTOM_KB = yes #
ENCODER_MAP_ENABLE = yes # replacing ENCODERS_CW_KEY method to this on 2022/08/31.

View file

@ -42,7 +42,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
MI_D_1, MI_B_1, MI_G_3, MI_A_3, MI_Ds_3, MI_Fs_2, MI_Ds_1, MI_C_1,
MO_SWAP, MI_B_5, MI_Gs_5, MI_G_5, MI_F_5, FN_MUTE,
MI_Cs_3, MI_A_5, MI_Fs_5, MI_E_5, MI_Ds_5, KC_VOLD, KC_VOLU,
MI_Cs_3, MI_A_5, MI_Fs_5, MI_E_5, MI_Ds_5,
MI_C_3, MI_D_3, MI_G_3, MI_As_4, MI_C_5, MI_D_5,
TG_SWAP, MI_B_2, MI_E_3, MI_Cs_4, MI_Fs_3, MI_A_3, MI_C_4, MI_E_4,
MI_A_2, MI_F_3, MI_As_3, MI_Gs_3, MI_B_3, MI_D_4, MI_Gs_4, MI_B_4,
@ -57,7 +57,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
MI_E_1, MI_E_2, MI_Fs_3, MI_Gs_3, MI_B_3, MI_F_2, MI_Cs_1, MI_F_1,
MO_SWAP, MI_A_5, MI_Gs_5, MI_Fs_5, MI_F_5, FN_MUTE,
MI_C_3, MI_G_5, MI_As_4, MI_C_5, MI_Ds_5, KC_VOLD, KC_VOLU,
MI_C_3, MI_G_5, MI_As_4, MI_C_5, MI_Ds_5,
MI_D_3, MI_Cs_3, MI_Gs_3, MI_As_3, MI_C_4, MI_D_5,
TG_SWAP, MI_B_2, MI_Fs_3, MI_Fs_4, MI_G_3, MI_B_3, MI_D_4, MI_G_4,
MI_A_2, MI_F_3, MI_E_3, MI_A_3, MI_Cs_4, MI_E_4, MI_A_4, MI_Cs_5,
@ -72,7 +72,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______,
@ -87,7 +87,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, MI_OCTD, MI_OCTU, MI_VELD, MI_VELU, _______,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_RMOD, RGB_MOD,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, VERSION,
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
RGB_SAD, RGB_SAI, RGB_HUD, RGB_HUI, RGB_SPD, RGB_SPI, RGB_VAD, RGB_VAI,
@ -95,6 +95,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
[_OPEN] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[_CLOSE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[_MISC] = { ENCODER_CCW_CW(_______, _______) },
[_FN] = { ENCODER_CCW_CW(RGB_RMOD, RGB_MOD) },
};
#endif
void my_init(void){
// Set octave to MI_OCT_0
midi_config.octave = MI_OCT_0 - MIDI_OCTAVE_MIN;

View file

@ -1,3 +1,5 @@
RGB_MATRIX_ENABLE = yes # Use RGB matrix (Don't enable this when RGBLIGHT_ENABLE is used.)
RGB_MATRIX_CUSTOM_KB = yes #
VIA_ENABLE = yes
ENCODER_MAP_ENABLE = yes # replacing ENCODERS_CW_KEY method to this on 2022/08/31.