Fix up via keymap builds. (#20383)
* Fix up via keymap builds. - Usages of old IS_PRESSED. * Fix up bad code. * Fix up bad code.
This commit is contained in:
parent
441988ef38
commit
5d6d959421
|
@ -19,31 +19,31 @@
|
|||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[0] = LAYOUT(
|
||||
QK_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP,
|
||||
KC_F1, KC_F2, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN,
|
||||
KC_F3, KC_F4, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END,
|
||||
QK_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP,
|
||||
KC_F1, KC_F2, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN,
|
||||
KC_F3, KC_F4, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END,
|
||||
KC_F5, KC_F6, KC_LCTL, KC_LWIN, KC_LALT, KC_SPACE, KC_NO, KC_VOLD, KC_RALT, KC_RCTL, KC_VOLU, KC_LEFT, KC_DOWN, KC_RGHT),
|
||||
|
||||
[1] = LAYOUT(
|
||||
QK_BOOT, 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_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_BSLS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_F7, KC_F8, KC_TRNS, BL_TOGG, BL_STEP, BL_BRTG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_F9, KC_F10, KC_TRNS, RGB_TOG, RGB_MOD, RGB_RMOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
QK_BOOT, 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_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_BSLS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_F7, KC_F8, KC_TRNS, BL_TOGG, BL_STEP, BL_BRTG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_F9, KC_F10, KC_TRNS, RGB_TOG, RGB_MOD, RGB_RMOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
|
||||
[2] = LAYOUT(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
|
||||
[3] = LAYOUT(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
|
||||
};
|
||||
|
@ -86,13 +86,13 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
|
|||
}
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
if (IS_PRESSED(encoder_ccw)) {
|
||||
if (encoder_ccw.pressed) {
|
||||
encoder_ccw.pressed = false;
|
||||
encoder_ccw.time = timer_read();
|
||||
action_exec(encoder_ccw);
|
||||
}
|
||||
|
||||
if (IS_PRESSED(encoder_cw)) {
|
||||
if (encoder_cw.pressed) {
|
||||
encoder_cw.pressed = false;
|
||||
encoder_cw.time = timer_read();
|
||||
action_exec(encoder_cw);
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
//#define GENESIS_LAYER_COLORS
|
||||
|
@ -26,34 +26,34 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
|
||||
[0] = LAYOUT_via_6x4(
|
||||
KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU,
|
||||
MO(1), KC_PSLS, KC_PAST, KC_PMNS,
|
||||
KC_P7, KC_P8, KC_P9, KC_PGUP,
|
||||
KC_P4, KC_P5, KC_P6, KC_PPLS,
|
||||
KC_P1, KC_P2, KC_P3, KC_PGDN,
|
||||
MO(1), KC_PSLS, KC_PAST, KC_PMNS,
|
||||
KC_P7, KC_P8, KC_P9, KC_PGUP,
|
||||
KC_P4, KC_P5, KC_P6, KC_PPLS,
|
||||
KC_P1, KC_P2, KC_P3, KC_PGDN,
|
||||
KC_P0, KC_SPC, KC_PDOT, KC_PENT),
|
||||
|
||||
[1] = LAYOUT_via_6x4(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, RGB_TOG, RGB_MOD, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
RGB_VAI, RGB_VAD, RGB_SPI, RGB_SPD,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, RGB_TOG, RGB_MOD, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
RGB_VAI, RGB_VAD, RGB_SPI, RGB_SPD,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
RGB_HUI, RGB_HUD, KC_TRNS, KC_TRNS),
|
||||
|
||||
[2] = LAYOUT_via_6x4(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
|
||||
[3] = LAYOUT_via_6x4(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
|
||||
};
|
||||
|
@ -113,35 +113,35 @@ keyevent_t encoder_right_ccw = {
|
|||
|
||||
keyevent_t encoder_right_cw = {
|
||||
.key = (keypos_t){.row = 5, .col = 3},
|
||||
.pressed = false
|
||||
.pressed = false,
|
||||
.type = KEY_EVENT
|
||||
};
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
if (IS_PRESSED(encoder_left_ccw)) {
|
||||
if (encoder_left_ccw.pressed) {
|
||||
encoder_left_ccw.pressed = false;
|
||||
encoder_left_ccw.time = timer_read();
|
||||
action_exec(encoder_left_ccw);
|
||||
}
|
||||
|
||||
if (IS_PRESSED(encoder_left_cw)) {
|
||||
if (encoder_left_cw.pressed) {
|
||||
encoder_left_cw.pressed = false;
|
||||
encoder_left_cw.time = timer_read();
|
||||
action_exec(encoder_left_cw);
|
||||
}
|
||||
|
||||
if (IS_PRESSED(encoder_right_ccw)) {
|
||||
if (encoder_right_ccw.pressed) {
|
||||
encoder_right_ccw.pressed = false;
|
||||
encoder_right_ccw.time = timer_read();
|
||||
action_exec(encoder_right_ccw);
|
||||
}
|
||||
|
||||
if (IS_PRESSED(encoder_right_cw)) {
|
||||
if (encoder_right_cw.pressed) {
|
||||
encoder_right_cw.pressed = false;
|
||||
encoder_right_cw.time = timer_read();
|
||||
action_exec(encoder_right_cw);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -75,25 +75,25 @@ keyevent_t encoder2_cw = {
|
|||
};
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
if (IS_PRESSED(encoder1_ccw)) {
|
||||
if (encoder1_ccw.pressed) {
|
||||
encoder1_ccw.pressed = false;
|
||||
encoder1_ccw.time = timer_read();
|
||||
action_exec(encoder1_ccw);
|
||||
}
|
||||
|
||||
if (IS_PRESSED(encoder1_cw)) {
|
||||
if (encoder1_cw.pressed) {
|
||||
encoder1_cw.pressed = false;
|
||||
encoder1_cw.time = timer_read();
|
||||
action_exec(encoder1_cw);
|
||||
}
|
||||
|
||||
if (IS_PRESSED(encoder2_ccw)) {
|
||||
if (encoder2_ccw.pressed) {
|
||||
encoder2_ccw.pressed = false;
|
||||
encoder2_ccw.time = timer_read();
|
||||
action_exec(encoder2_ccw);
|
||||
}
|
||||
|
||||
if (IS_PRESSED(encoder2_cw)) {
|
||||
if (encoder2_cw.pressed) {
|
||||
encoder2_cw.pressed = false;
|
||||
encoder2_cw.time = timer_read();
|
||||
action_exec(encoder2_cw);
|
||||
|
|
|
@ -67,25 +67,25 @@ keyevent_t encoder2_cw = {
|
|||
};
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
if (IS_PRESSED(encoder1_ccw)) {
|
||||
if (encoder1_ccw.pressed) {
|
||||
encoder1_ccw.pressed = false;
|
||||
encoder1_ccw.time = timer_read();
|
||||
action_exec(encoder1_ccw);
|
||||
}
|
||||
|
||||
if (IS_PRESSED(encoder1_cw)) {
|
||||
if (encoder1_cw.pressed) {
|
||||
encoder1_cw.pressed = false;
|
||||
encoder1_cw.time = timer_read();
|
||||
action_exec(encoder1_cw);
|
||||
}
|
||||
|
||||
if (IS_PRESSED(encoder2_ccw)) {
|
||||
if (encoder2_ccw.pressed) {
|
||||
encoder2_ccw.pressed = false;
|
||||
encoder2_ccw.time = timer_read();
|
||||
action_exec(encoder2_ccw);
|
||||
}
|
||||
|
||||
if (IS_PRESSED(encoder2_cw)) {
|
||||
if (encoder2_cw.pressed) {
|
||||
encoder2_cw.pressed = false;
|
||||
encoder2_cw.time = timer_read();
|
||||
action_exec(encoder2_cw);
|
||||
|
|
|
@ -130,49 +130,49 @@ keyevent_t encoder4_cw = {
|
|||
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
if (IS_PRESSED(encoder1_ccw)) {
|
||||
if (encoder1_ccw.pressed) {
|
||||
encoder1_ccw.pressed = false;
|
||||
encoder1_ccw.time = timer_read();
|
||||
action_exec(encoder1_ccw);
|
||||
}
|
||||
|
||||
if (IS_PRESSED(encoder1_cw)) {
|
||||
if (encoder1_cw.pressed) {
|
||||
encoder1_cw.pressed = false;
|
||||
encoder1_cw.time = timer_read();
|
||||
action_exec(encoder1_cw);
|
||||
}
|
||||
|
||||
if (IS_PRESSED(encoder2_ccw)) {
|
||||
if (encoder2_ccw.pressed) {
|
||||
encoder2_ccw.pressed = false;
|
||||
encoder2_ccw.time = timer_read();
|
||||
action_exec(encoder2_ccw);
|
||||
}
|
||||
|
||||
if (IS_PRESSED(encoder2_cw)) {
|
||||
if (encoder2_cw.pressed) {
|
||||
encoder2_cw.pressed = false;
|
||||
encoder2_cw.time = timer_read();
|
||||
action_exec(encoder2_cw);
|
||||
}
|
||||
|
||||
if (IS_PRESSED(encoder3_ccw)) {
|
||||
if (encoder3_ccw.pressed) {
|
||||
encoder3_ccw.pressed = false;
|
||||
encoder3_ccw.time = timer_read();
|
||||
action_exec(encoder3_ccw);
|
||||
}
|
||||
|
||||
if (IS_PRESSED(encoder3_cw)) {
|
||||
if (encoder3_cw.pressed) {
|
||||
encoder3_cw.pressed = false;
|
||||
encoder3_cw.time = timer_read();
|
||||
action_exec(encoder3_cw);
|
||||
}
|
||||
|
||||
if (IS_PRESSED(encoder4_ccw)) {
|
||||
if (encoder4_ccw.pressed) {
|
||||
encoder4_ccw.pressed = false;
|
||||
encoder4_ccw.time = timer_read();
|
||||
action_exec(encoder4_ccw);
|
||||
}
|
||||
|
||||
if (IS_PRESSED(encoder4_cw)) {
|
||||
if (encoder4_cw.pressed) {
|
||||
encoder4_cw.pressed = false;
|
||||
encoder4_cw.time = timer_read();
|
||||
action_exec(encoder4_cw);
|
||||
|
|
|
@ -31,7 +31,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_ON,
|
||||
_______, _______, _______, BL_TOGG, _______, BL_DOWN, BL_OFF, BL_UP,
|
||||
_______, _______, _______, BL_TOGG, _______, BL_DOWN, BL_OFF, BL_UP,
|
||||
_______, _______
|
||||
),
|
||||
[2] = LAYOUT_all(
|
||||
|
@ -65,13 +65,13 @@ keyevent_t encoder_cw = {
|
|||
};
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
if (IS_PRESSED(encoder_ccw)) {
|
||||
if (encoder_ccw.pressed) {
|
||||
encoder_ccw.pressed = false;
|
||||
encoder_ccw.time = timer_read();
|
||||
action_exec(encoder_ccw);
|
||||
}
|
||||
|
||||
if (IS_PRESSED(encoder_cw)) {
|
||||
if (encoder_cw.pressed) {
|
||||
encoder_cw.pressed = false;
|
||||
encoder_cw.time = timer_read();
|
||||
action_exec(encoder_cw);
|
||||
|
|
|
@ -100,7 +100,7 @@ void encoder_action_register(uint8_t index, bool clockwise) {
|
|||
keyevent_t encoder_event = (keyevent_t) {
|
||||
.key = clockwise ? ENC_CW : ENC_CCW,
|
||||
.pressed = true,
|
||||
.time = timer_read()
|
||||
.time = timer_read(),
|
||||
.type = KEY_EVENT
|
||||
};
|
||||
encoder_state = (clockwise ^ 1) | (clockwise << 1);
|
||||
|
|
|
@ -59,13 +59,13 @@ keyevent_t encoder_cw = {
|
|||
};
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
if (IS_PRESSED(encoder_ccw)) {
|
||||
if (encoder_ccw.pressed) {
|
||||
encoder_ccw.pressed = false;
|
||||
encoder_ccw.time = timer_read();
|
||||
action_exec(encoder_ccw);
|
||||
}
|
||||
|
||||
if (IS_PRESSED(encoder_cw)) {
|
||||
if (encoder_cw.pressed) {
|
||||
encoder_cw.pressed = false;
|
||||
encoder_cw.time = timer_read();
|
||||
action_exec(encoder_cw);
|
||||
|
|
|
@ -65,13 +65,13 @@ keyevent_t encoder_cw = {
|
|||
};
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
if (IS_PRESSED(encoder_ccw)) {
|
||||
if (encoder_ccw.pressed) {
|
||||
encoder_ccw.pressed = false;
|
||||
encoder_ccw.time = timer_read();
|
||||
action_exec(encoder_ccw);
|
||||
}
|
||||
|
||||
if (IS_PRESSED(encoder_cw)) {
|
||||
if (encoder_cw.pressed) {
|
||||
encoder_cw.pressed = false;
|
||||
encoder_cw.time = timer_read();
|
||||
action_exec(encoder_cw);
|
||||
|
|
|
@ -40,13 +40,13 @@ keyevent_t encoder_cw = {
|
|||
};
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
if (IS_PRESSED(encoder_ccw)) {
|
||||
if (encoder_ccw.pressed) {
|
||||
encoder_ccw.pressed = false;
|
||||
encoder_ccw.time = timer_read();
|
||||
action_exec(encoder_ccw);
|
||||
}
|
||||
|
||||
if (IS_PRESSED(encoder_cw)) {
|
||||
if (encoder_cw.pressed) {
|
||||
encoder_cw.pressed = false;
|
||||
encoder_cw.time = timer_read();
|
||||
action_exec(encoder_cw);
|
||||
|
|
|
@ -48,13 +48,13 @@ keyevent_t encoder_cw = {
|
|||
};
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
if (IS_PRESSED(encoder_ccw)) {
|
||||
if (encoder_ccw.pressed) {
|
||||
encoder_ccw.pressed = false;
|
||||
encoder_ccw.time = timer_read();
|
||||
action_exec(encoder_ccw);
|
||||
}
|
||||
|
||||
if (IS_PRESSED(encoder_cw)) {
|
||||
if (encoder_cw.pressed) {
|
||||
encoder_cw.pressed = false;
|
||||
encoder_cw.time = timer_read();
|
||||
action_exec(encoder_cw);
|
||||
|
|
|
@ -48,13 +48,13 @@ keyevent_t encoder1_ccw = {.key = (keypos_t){.row = 4, .col = 4}, .pressed = fal
|
|||
keyevent_t encoder1_cw = {.key = (keypos_t){.row = 4, .col = 6}, .pressed = false, .type = KEY_EVENT};
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
if (IS_PRESSED(encoder1_ccw)) {
|
||||
if (encoder1_ccw.pressed) {
|
||||
encoder1_ccw.pressed = false;
|
||||
encoder1_ccw.time = timer_read();
|
||||
action_exec(encoder1_ccw);
|
||||
}
|
||||
|
||||
if (IS_PRESSED(encoder1_cw)) {
|
||||
if (encoder1_cw.pressed) {
|
||||
encoder1_cw.pressed = false;
|
||||
encoder1_cw.time = timer_read();
|
||||
action_exec(encoder1_cw);
|
||||
|
|
|
@ -205,7 +205,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
break;
|
||||
#ifdef ZEAL_RGB
|
||||
case BL_TOGG:
|
||||
if (IS_PRESSED(record->event)) {
|
||||
if (record->event.pressed) {
|
||||
if (g_config.effect) {
|
||||
last_effect = g_config.effect;
|
||||
g_config.effect = 0;
|
||||
|
@ -215,7 +215,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
}
|
||||
return false;
|
||||
case EFFECT...EFFECT_END:
|
||||
if (IS_PRESSED(record->event)) {
|
||||
if (record->event.pressed) {
|
||||
uint8_t effect = keycode - EFFECT;
|
||||
if(effect == g_config.effect)
|
||||
effect = 0; // Toggle effect on second press
|
||||
|
|
Loading…
Reference in New Issue