Add KemoNine Qvex Lynepad config/keymap
This commit is contained in:
parent
090d9694fb
commit
7c627e88a6
|
@ -17,3 +17,5 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
// place overrides here
|
// place overrides here
|
||||||
|
#undef RGBLIGHT_ANIMATIONS
|
||||||
|
#define RGBLIGHT_LAYERS
|
||||||
|
|
|
@ -15,8 +15,6 @@
|
||||||
*/
|
*/
|
||||||
#include QMK_KEYBOARD_H
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
#include <print.h>
|
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
/* Keymap (Base Layer) Default Layer
|
/* Keymap (Base Layer) Default Layer
|
||||||
* |----------------------------|
|
* |----------------------------|
|
||||||
|
@ -26,27 +24,51 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
* |----------------------------|
|
* |----------------------------|
|
||||||
*/
|
*/
|
||||||
[0] = LAYOUT_Lynepad(
|
[0] = LAYOUT_Lynepad(
|
||||||
KC_MS_BTN4, KC_MS_BTN2, KC_MS_UP, KC_MS_BTN1,
|
KC_NO, KC_MS_BTN2, KC_MS_UP, KC_MS_BTN1,
|
||||||
KC_MS_BTN5, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT,
|
KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT,
|
||||||
KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2
|
KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Customized HSV values for layer highlights
|
||||||
|
#define HSV_KMN_PURPLE 191, 255, 120
|
||||||
|
|
||||||
|
const rgblight_segment_t PROGMEM led_underglow_purple[] = RGBLIGHT_LAYER_SEGMENTS(
|
||||||
|
{0, RGBLED_NUM, HSV_KMN_PURPLE}
|
||||||
|
);
|
||||||
|
|
||||||
|
// Array of layers for management
|
||||||
|
const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(
|
||||||
|
led_underglow_purple
|
||||||
|
);
|
||||||
|
|
||||||
|
// Layer color init
|
||||||
|
void keyboard_post_init_user(void) {
|
||||||
|
rgblight_layers = my_rgb_layers;
|
||||||
|
rgblight_sethsv_noeeprom(HSV_KMN_PURPLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Adjust layers based on which is active
|
||||||
|
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||||
|
rgblight_set_layer_state(0, layer_state_cmp(state, 0));
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
// Standard encoder functionality
|
// Standard encoder functionality
|
||||||
void encoder_update_user(uint8_t index, bool clockwise) {
|
void encoder_update_user(uint8_t index, bool clockwise) {
|
||||||
// Process encoder rotational movements
|
// Process encoder rotational movements
|
||||||
if (index == 0) { /* First encoder */
|
if (index == 0) { /* First encoder */
|
||||||
if (clockwise) {
|
|
||||||
tap_code(KC_AUDIO_VOL_DOWN);
|
|
||||||
} else {
|
|
||||||
tap_code(KC_AUDIO_VOL_UP);
|
|
||||||
}
|
|
||||||
} else if (index == 1) { /* Second encoder */
|
|
||||||
if (clockwise) {
|
if (clockwise) {
|
||||||
tap_code(KC_MS_WH_UP);
|
tap_code(KC_MS_WH_UP);
|
||||||
} else {
|
} else {
|
||||||
tap_code(KC_MS_WH_DOWN);
|
tap_code(KC_MS_WH_DOWN);
|
||||||
}
|
}
|
||||||
|
} else if (index == 1) { /* Second encoder */
|
||||||
|
if (clockwise) {
|
||||||
|
tap_code(KC_AUDIO_VOL_DOWN);
|
||||||
|
} else {
|
||||||
|
tap_code(KC_AUDIO_VOL_UP);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,15 +94,13 @@ void matrix_scan_user(void) {
|
||||||
if (enc1Center < ENC_TILT_THRESHOLD) {
|
if (enc1Center < ENC_TILT_THRESHOLD) {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
reset_keyboard();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (enc2Center != enc2CenterPrev) {
|
if (enc2Center != enc2CenterPrev) {
|
||||||
if (enc2Center < ENC_TILT_THRESHOLD) {
|
if (enc2Center < ENC_TILT_THRESHOLD) {
|
||||||
register_code16(KC_MS_BTN3);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
unregister_code16(KC_MS_BTN3);
|
reset_keyboard();
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Encoder sets ALL values when center is pressed so bail out at this point\
|
* Encoder sets ALL values when center is pressed so bail out at this point\
|
||||||
|
@ -90,34 +110,26 @@ void matrix_scan_user(void) {
|
||||||
}
|
}
|
||||||
if (enc2Up != enc2UpPrev) {
|
if (enc2Up != enc2UpPrev) {
|
||||||
if (enc2Up < ENC_TILT_THRESHOLD) {
|
if (enc2Up < ENC_TILT_THRESHOLD) {
|
||||||
register_code16(RGB_VAI);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
unregister_code16(RGB_VAI);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (enc2Down != enc2DownPrev) {
|
if (enc2Down != enc2DownPrev) {
|
||||||
if (enc2Down < ENC_TILT_THRESHOLD) {
|
if (enc2Down < ENC_TILT_THRESHOLD) {
|
||||||
register_code16(RGB_VAD);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
unregister_code16(RGB_VAD);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (enc2Left != enc2LeftPrev) {
|
if (enc2Left != enc2LeftPrev) {
|
||||||
if (enc2Left < ENC_TILT_THRESHOLD) {
|
if (enc2Left < ENC_TILT_THRESHOLD) {
|
||||||
register_code16(RGB_TOG);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
unregister_code16(RGB_TOG);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (enc2Right != enc2RightPrev) {
|
if (enc2Right != enc2RightPrev) {
|
||||||
if (enc2Right < ENC_TILT_THRESHOLD) {
|
if (enc2Right < ENC_TILT_THRESHOLD) {
|
||||||
register_code16(RGB_MODE_FORWARD);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
unregister_code16(RGB_MODE_FORWARD);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
1180
keyboards/qvex/lynepad/qvex_lynepad_kemonine.hex
Normal file
1180
keyboards/qvex/lynepad/qvex_lynepad_kemonine.hex
Normal file
File diff suppressed because it is too large
Load diff
21
qmk/keyboards/qvex/lynepad/keymaps/kemonine/config.h
Normal file
21
qmk/keyboards/qvex/lynepad/keymaps/kemonine/config.h
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
/* 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
// place overrides here
|
||||||
|
#undef RGBLIGHT_ANIMATIONS
|
||||||
|
#define RGBLIGHT_LAYERS
|
135
qmk/keyboards/qvex/lynepad/keymaps/kemonine/keymap.c
Normal file
135
qmk/keyboards/qvex/lynepad/keymaps/kemonine/keymap.c
Normal file
|
@ -0,0 +1,135 @@
|
||||||
|
/* 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 | |
|
||||||
|
* | 9 | 10 | 11 | |
|
||||||
|
* |----------------------------|
|
||||||
|
*/
|
||||||
|
[0] = LAYOUT_Lynepad(
|
||||||
|
KC_NO, KC_MS_BTN2, KC_MS_UP, KC_MS_BTN1,
|
||||||
|
KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT,
|
||||||
|
KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
// Customized HSV values for layer highlights
|
||||||
|
#define HSV_KMN_PURPLE 191, 255, 120
|
||||||
|
|
||||||
|
const rgblight_segment_t PROGMEM led_underglow_purple[] = RGBLIGHT_LAYER_SEGMENTS(
|
||||||
|
{0, RGBLED_NUM, HSV_KMN_PURPLE}
|
||||||
|
);
|
||||||
|
|
||||||
|
// Array of layers for management
|
||||||
|
const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(
|
||||||
|
led_underglow_purple
|
||||||
|
);
|
||||||
|
|
||||||
|
// Layer color init
|
||||||
|
void keyboard_post_init_user(void) {
|
||||||
|
rgblight_layers = my_rgb_layers;
|
||||||
|
rgblight_sethsv_noeeprom(HSV_KMN_PURPLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Adjust layers based on which is active
|
||||||
|
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||||
|
rgblight_set_layer_state(0, layer_state_cmp(state, 0));
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Standard encoder functionality
|
||||||
|
void encoder_update_user(uint8_t index, bool clockwise) {
|
||||||
|
// Process encoder rotational movements
|
||||||
|
if (index == 0) { /* First encoder */
|
||||||
|
if (clockwise) {
|
||||||
|
tap_code(KC_MS_WH_UP);
|
||||||
|
} else {
|
||||||
|
tap_code(KC_MS_WH_DOWN);
|
||||||
|
}
|
||||||
|
} else if (index == 1) { /* Second encoder */
|
||||||
|
if (clockwise) {
|
||||||
|
tap_code(KC_AUDIO_VOL_DOWN);
|
||||||
|
} else {
|
||||||
|
tap_code(KC_AUDIO_VOL_UP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Encoder press / tilt event handling
|
||||||
|
// the core lynepad implementation will update the below variables on each matrix scan
|
||||||
|
// Update the various codes below for customizing the tilt / push config
|
||||||
|
|
||||||
|
extern int16_t enc1Center;
|
||||||
|
extern int16_t enc1CenterPrev;
|
||||||
|
extern int16_t enc2Center;
|
||||||
|
extern int16_t enc2CenterPrev;
|
||||||
|
extern int16_t enc2Up;
|
||||||
|
extern int16_t enc2UpPrev;
|
||||||
|
extern int16_t enc2Down;
|
||||||
|
extern int16_t enc2DownPrev;
|
||||||
|
extern int16_t enc2Left;
|
||||||
|
extern int16_t enc2LeftPrev;
|
||||||
|
extern int16_t enc2Right;
|
||||||
|
extern int16_t enc2RightPrev;
|
||||||
|
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
if (enc1Center != enc1CenterPrev) {
|
||||||
|
if (enc1Center < ENC_TILT_THRESHOLD) {
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (enc2Center != enc2CenterPrev) {
|
||||||
|
if (enc2Center < ENC_TILT_THRESHOLD) {
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
reset_keyboard();
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Encoder sets ALL values when center is pressed so bail out at this point\
|
||||||
|
* to avoid the rest of the encoder buttons registering events
|
||||||
|
*/
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (enc2Up != enc2UpPrev) {
|
||||||
|
if (enc2Up < ENC_TILT_THRESHOLD) {
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (enc2Down != enc2DownPrev) {
|
||||||
|
if (enc2Down < ENC_TILT_THRESHOLD) {
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (enc2Left != enc2LeftPrev) {
|
||||||
|
if (enc2Left < ENC_TILT_THRESHOLD) {
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (enc2Right != enc2RightPrev) {
|
||||||
|
if (enc2Right < ENC_TILT_THRESHOLD) {
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
1
qmk/keyboards/qvex/lynepad/keymaps/kemonine/readme.md
Normal file
1
qmk/keyboards/qvex/lynepad/keymaps/kemonine/readme.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
# KemoNine's personal keymap for the Qvex Lynepad
|
Loading…
Reference in a new issue