keyboard/qmk/keyboards/qvex/lynepad/keymaps/default/keymap.c

71 lines
2.1 KiB
C

/* Copyright 2020 KemoNine
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap (Base Layer) Default Layer
* |----------------------------|
* | 1 | 2 | 3 | 4 | |
* | 5 | 6 | 7 | 8 | |
* |----------------------------|
* | | OK ||
* |----------------------------|
* | 9 | 10 | 11 | |
* |----------------------------|
* | | Up | |
* | | Left | OK | Right |
* | | Down | |
* |----------------------------|
*/
[0] = LAYOUT(
KC_NO, KC_MS_BTN2, KC_MS_UP, KC_MS_BTN1,
KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT,
KC_ESC,
TO(0), TO(0), KC_NO,
KC_UP,
KC_LEFT, KC_ENTER, KC_RIGHT,
KC_DOWN
)
};
void encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) { /* First encoder */
if (clockwise) {
tap_code(KC_MS_WH_RIGHT);
} else {
tap_code(KC_MS_WH_LEFT);
}
} else if (index == 1) { /* Second encoder */
if (clockwise) {
tap_code(KC_MS_WH_DOWN);
} else {
tap_code(KC_MS_WH_UP);
}
}
}
void matrix_init_user(void) {
}
void matrix_scan_user(void) {
}
void led_set_user(uint8_t usb_led) {
}