|
|
@ -23,22 +23,53 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
|
|
|
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_ENT, KC_PGUP, |
|
|
|
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_NUHS, KC_PGDN, |
|
|
|
KC_LSFT, KC_NUBS, 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_RGHT |
|
|
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_RGHT, |
|
|
|
_______, _______ |
|
|
|
), |
|
|
|
[1] = LAYOUT_iso( |
|
|
|
RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, |
|
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
|
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
|
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_ON, |
|
|
|
_______, _______, _______, BL_TOGG, _______, BL_DEC, BL_OFF, BL_INC |
|
|
|
_______, _______, _______, BL_TOGG, _______, BL_DEC, BL_OFF, BL_INC, |
|
|
|
_______, _______ |
|
|
|
) |
|
|
|
}; |
|
|
|
|
|
|
|
bool encoder_update_user(uint8_t index, bool clockwise) { |
|
|
|
void encoder_update_user(uint8_t index, bool clockwise) { |
|
|
|
if (clockwise) { |
|
|
|
tap_code(KC_VOLU); |
|
|
|
//encoder_cw.pressed = true; |
|
|
|
//encoder_cw.time = (timer_read() | 1); |
|
|
|
//action_exec(encoder_cw); |
|
|
|
|
|
|
|
keyevent_t pressed; |
|
|
|
// get keycode mapped to key at row 5, col 1 |
|
|
|
pressed = (keyevent_t){ .key = (keypos_t){.row = 5, .col = 1}, .pressed = true, .time = (timer_read() | 1)}; |
|
|
|
uint16_t keycode = get_event_keycode(pressed, false); |
|
|
|
if (keycode > 0) { |
|
|
|
uint16_t held_keycode_timer = timer_read(); |
|
|
|
register_code16(keycode); |
|
|
|
while (timer_elapsed(held_keycode_timer) < MEDIA_KEY_DELAY){ |
|
|
|
// nothing |
|
|
|
} |
|
|
|
unregister_code16(keycode); |
|
|
|
} |
|
|
|
} else { |
|
|
|
tap_code(KC_VOLD); |
|
|
|
} |
|
|
|
return true; |
|
|
|
//encoder_ccw.pressed = true; |
|
|
|
//encoder_ccw.time = (timer_read() | 1); |
|
|
|
//action_exec(encoder_ccw); |
|
|
|
|
|
|
|
keyevent_t pressed; |
|
|
|
// get keycode mapped to key at row 5, col 0 |
|
|
|
pressed = (keyevent_t){ .key = (keypos_t){.row = 5, .col = 0}, .pressed = true, .time = (timer_read() | 1)}; |
|
|
|
uint16_t keycode = get_event_keycode(pressed, false); |
|
|
|
if (keycode > 0) { |
|
|
|
uint16_t held_keycode_timer = timer_read(); |
|
|
|
register_code16(keycode); |
|
|
|
while (timer_elapsed(held_keycode_timer) < MEDIA_KEY_DELAY){ |
|
|
|
// nothing |
|
|
|
} |
|
|
|
unregister_code16(keycode); |
|
|
|
} |
|
|
|
} |
|
|
|
} |