keychron_qmk_firmware/keyboards/keebio/bdn9/keymaps/via/keymap.c
Joshua Rubin 7f4ce4a8b7
Add via support to keebio/bdn9 (#8620)
Signed-off-by: Joshua Rubin <me@jawa.dev>
2020-04-13 07:32:46 +02:00

53 lines
949 B
C

#include QMK_KEYBOARD_H
enum layer_names {
_ZERO,
_ONE,
_TWO,
_THREE
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_ZERO] = LAYOUT(
KC_MPLY, KC_HOME, KC_MUTE,
MO(1), KC_UP, RGB_MOD,
KC_LEFT, KC_DOWN, KC_RGHT
),
[_ONE] = LAYOUT(
RESET, BL_STEP, KC_STOP,
_______, KC_HOME, RGB_MOD,
KC_MPRV, KC_END , KC_MNXT
),
[_TWO] = LAYOUT(
_______, _______, _______,
_______, _______, _______,
_______, _______, _______
),
[_THREE] = LAYOUT(
_______, _______, _______,
_______, _______, _______,
_______, _______, _______
)
};
void encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
} else if (index == 1) {
if (clockwise) {
tap_code(KC_WH_U);
} else {
tap_code(KC_WH_D);
}
}
}