keychron_qmk_firmware/keyboards/ncc1701kb/keymaps/default/keymap.c
Nick Brassel 219afaba42
Reworked backlight keycodes. (#18961)
Co-authored-by: Ryan <fauxpark@gmail.com>
2022-11-06 08:11:59 +11:00

53 lines
1.1 KiB
C

#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* LAYER 0
* ,-----------------------.
* | << | MUTE | >> | ENCODER - PRESS (MUTE) / KNOB (VOLUME CONTROL)
* |-------+-------+-------|
* | STOP | PLAY | MEDIA |
* |-------+-------+-------|
* | CALC | MAIL | PC/FN |
* `-----------------------'
*/
[0] = LAYOUT(
KC_MPRV, KC_MUTE, KC_MNXT,
KC_MSTP, KC_MPLY, KC_MSEL,
KC_CALC, KC_MAIL, LT(1, KC_MYCM)
),
/* LAYER 1
* ,-----------------------.
* |BL TOG | | BREATH|
* |-------+-------+-------|
* | BL + | BL - |BL CYCL|
* |-------+-------+-------|
* | BL ON | BL OFF| |
* `-----------------------'
*/
[1] = LAYOUT(
BL_TOGG, KC_TRNS, BL_BRTG,
BL_UP, BL_DOWN, BL_STEP,
BL_ON, BL_OFF, KC_TRNS
)
};
bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) { /* First encoder */
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
} else if (index == 1) { /* Second encoder */
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
}
return true;
}