#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(
KC_7, KC_8, KC_9, KC_BSPC,
KC_4, KC_5, KC_6, KC_ESC,
KC_1, KC_2, KC_3, KC_TAB,
KC_BTN1, TT(1), KC_0, LSFT_T(KC_DOT), KC_ENTER
),
[1] = LAYOUT(
_______, _______, _______, RESET,
_______, _______, _______, KC_KP_PLUS,
_______, _______, _______, KC_KP_MINUS,
KC_LOCK, _______, _______, _______, KC_EQL
),
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
void keyboard_post_init_user(void) {
}
bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) {
switch (get_highest_layer(layer_state)) {
case 0:
if (clockwise) {
tap_code(KC_MS_R);
} else {
tap_code(KC_MS_L);
}
break;
default:
if (clockwise) {
tap_code(KC_EQL);
} else {
tap_code(KC_MINS);
}
break;
}
} else if (index == 1) {
switch (get_highest_layer(layer_state)) {
case 0:
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
break;
default:
if (clockwise) {
tap_code(KC_RIGHT);
} else {
tap_code(KC_LEFT);
}
break;
}
}
return true;
}