mirror of
https://github.com/Keychron/qmk_firmware.git
synced 2024-11-22 00:16:41 +06:00
Merge remote-tracking branch 'origin/master' into develop
This commit is contained in:
commit
0435381c91
|
@ -103,6 +103,19 @@ layer_state_t layer_state_set_user(layer_state_t state) {
|
|||
return state;
|
||||
}
|
||||
|
||||
#ifdef ENCODER_MAP_ENABLE
|
||||
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
|
||||
#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
|
||||
[_MEDIA] = { ENCODER_CCW_CW(RGB_HUD, RGB_HUI), ENCODER_CCW_CW(RGB_SAD, RGB_SAI), ENCODER_CCW_CW(RGB_VAD, RGB_VAI) },
|
||||
[_XCODE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_UP, KC_DOWN), ENCODER_CCW_CW(KC_PGUP, KC_PGDN) },
|
||||
#else
|
||||
[_MEDIA] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_UP, KC_DOWN), ENCODER_CCW_CW(KC_PGUP, KC_PGDN) },
|
||||
[_XCODE] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) },
|
||||
#endif
|
||||
[_CUST1] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) },
|
||||
[_CUST2] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) },
|
||||
};
|
||||
#else
|
||||
bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
uint8_t layer = get_highest_layer(layer_state);
|
||||
|
||||
|
@ -155,3 +168,4 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -12,6 +12,10 @@
|
|||
|
||||
## Changelog
|
||||
|
||||
### 2022-12-09 - 1.1
|
||||
|
||||
- Add ENCODER_MAP_ENABLE from default VIA definition
|
||||
|
||||
### 2022-01-17 - 1.0
|
||||
|
||||
- Initial release
|
||||
|
|
|
@ -3,3 +3,4 @@ LTO_ENABLE = yes
|
|||
MOUSEKEY_ENABLE = yes
|
||||
CONSOLE_ENABLE = no
|
||||
COMMAND_ENABLE = no
|
||||
ENCODER_MAP_ENABLE = yes
|
||||
|
|
|
@ -62,30 +62,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
)
|
||||
),
|
||||
};
|
||||
|
||||
// clang-format on
|
||||
|
||||
bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
if (index == 0) {
|
||||
if (clockwise) {
|
||||
tap_code(KC_PGDN);
|
||||
} else {
|
||||
tap_code(KC_PGUP);
|
||||
}
|
||||
return false;
|
||||
} else if (index == 1) {
|
||||
if (clockwise) {
|
||||
tap_code(KC_VOLU);
|
||||
} else {
|
||||
tap_code(KC_VOLD);
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#ifdef ENCODER_MAP_ENABLE
|
||||
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
|
||||
[0] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(KC_VOLU, KC_VOLD) },
|
||||
[1] = { ENCODER_CCW_CW(RGB_MOD, RGB_RMOD), ENCODER_CCW_CW(KC_MNXT, KC_MPRV) },
|
||||
[2] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) },
|
||||
[3] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) },
|
||||
};
|
||||
#endif
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
|
|
|
@ -13,6 +13,10 @@
|
|||
|
||||
## Changelog
|
||||
|
||||
### 2022-12-09 - 1.2
|
||||
|
||||
- Add ENCODER_MAP_ENABLE from default VIA definition
|
||||
|
||||
### 2022-03-04 - 1.1
|
||||
|
||||
- Correct function row to change LED backlights, not underglow
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
VIA_ENABLE = yes
|
||||
LTO_ENABLE = yes
|
||||
ENCODER_MAP_ENABLE = yes
|
||||
|
|
Loading…
Reference in New Issue
Block a user