update kemonine lynepad config to include LR layers

This commit is contained in:
kemonine 2020-11-02 02:26:29 -05:00
parent 22dd632811
commit 6e289936e0
10 changed files with 1544 additions and 1268 deletions

View file

@ -24,33 +24,59 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |----------------------------|
*/
[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
LCTL(LALT(KC_TAB)), KC_MS_BTN2, KC_MS_UP, KC_MS_BTN1,
LGUI(KC_DOWN), KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT,
TO(0), TO(1), TO(2)
),
[1] = LAYOUT_Lynepad(
LCTL(LALT(KC_2)), LCTL(KC_BSPACE), LSFT(KC_X), LSFT(KC_P),
LSFT(KC_TAB), KC_G, KC_E, KC_C,
TO(0), TO(1), TO(2)
),
[2] = LAYOUT_Lynepad(
LCTL(LALT(KC_1)), LCTL(KC_LBRACKET), LCTL(KC_RBRACKET), KC_W,
LSFT(KC_TAB), KC_Q, LCTL(LALT(KC_R)), KC_R,
TO(0), TO(1), TO(2)
)
};
// Customized HSV values for layer highlights
#define HSV_KMN_PURPLE 191, 255, 120
#define HSV_KMN_GREEN 85, 255, 120
#define HSV_KMN_YELLOW 43, 255, 120
const rgblight_segment_t PROGMEM led_underglow_purple[] = RGBLIGHT_LAYER_SEGMENTS(
{0, RGBLED_NUM, HSV_KMN_PURPLE}
);
const rgblight_segment_t PROGMEM led_underglow_green[] = RGBLIGHT_LAYER_SEGMENTS(
{0, RGBLED_NUM, HSV_KMN_GREEN}
);
const rgblight_segment_t PROGMEM led_underglow_yellow[] = RGBLIGHT_LAYER_SEGMENTS(
{0, RGBLED_NUM, HSV_KMN_YELLOW}
);
// Array of layers for management
const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(
led_underglow_purple
led_underglow_purple,
led_underglow_green,
led_underglow_yellow
);
// Layer color init
void keyboard_post_init_user(void) {
rgblight_layers = my_rgb_layers;
layer_clear();
layer_on(0);
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));
rgblight_set_layer_state(1, layer_state_cmp(state, 1));
rgblight_set_layer_state(2, layer_state_cmp(state, 2));
return state;
}
@ -59,16 +85,66 @@ void encoder_update_user(uint8_t index, bool clockwise) {
// Process encoder rotational movements
if (index == 0) { /* First encoder */
if (clockwise) {
if (layer_state_is(0)) {
tap_code(KC_MS_WH_UP);
}
else if (layer_state_is(1)) {
tap_code(KC_LBRACKET);
}
else if (layer_state_is(2)) {
register_code16(KC_LCTRL);
register_code16(KC_MINUS);
unregister_code16(KC_MINUS);
unregister_code16(KC_LCTRL);
}
} else {
if (layer_state_is(0)) {
tap_code(KC_MS_WH_DOWN);
}
else if (layer_state_is(1)) {
tap_code(KC_RBRACKET);
}
else if (layer_state_is(2)) {
register_code16(KC_LCTRL);
register_code16(KC_EQUAL);
unregister_code16(KC_EQUAL);
unregister_code16(KC_LCTRL);
}
}
} else if (index == 1) { /* Second encoder */
if (clockwise) {
if (layer_state_is(0)) {
tap_code(KC_AUDIO_VOL_DOWN);
}
else if (layer_state_is(1)) {
register_code16(KC_LCTRL);
register_code16(KC_MINUS);
unregister_code16(KC_MINUS);
unregister_code16(KC_LCTRL);
}
else if (layer_state_is(2)) {
register_code16(KC_LSFT);
register_code16(KC_UP);
unregister_code16(KC_UP);
unregister_code16(KC_LSFT);
}
} else {
if (layer_state_is(0)) {
tap_code(KC_AUDIO_VOL_UP);
}
else if (layer_state_is(1)) {
register_code16(KC_LCTRL);
register_code16(KC_EQUAL);
unregister_code16(KC_EQUAL);
unregister_code16(KC_LCTRL);
}
else if (layer_state_is(2)) {
register_code16(KC_LSFT);
register_code16(KC_DOWN);
unregister_code16(KC_DOWN);
unregister_code16(KC_LSFT);
}
}
}
}
@ -92,16 +168,20 @@ extern int16_t enc2RightPrev;
void matrix_scan_user(void) {
if (enc1Center != enc1CenterPrev) {
if (enc1Center < ENC_TILT_THRESHOLD) {
register_code16(KC_ESC);
}
else {
unregister_code16(KC_ESC);
}
}
if (enc2Center != enc2CenterPrev) {
if (enc2Center < ENC_TILT_THRESHOLD) {
}
else {
if (layer_state_is(0)) {
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
@ -110,30 +190,62 @@ void matrix_scan_user(void) {
}
if (enc2Up != enc2UpPrev) {
if (enc2Up < ENC_TILT_THRESHOLD) {
if (layer_state_is(0)) {
register_code16(KC_MS_WH_UP);
}
else if (layer_state_is(1)) {
register_code16(KC_UP);
}
}
else {
if (layer_state_is(0)) {
unregister_code16(KC_MS_WH_UP);
}
else if (layer_state_is(1)) {
unregister_code16(KC_UP);
}
}
}
if (enc2Down != enc2DownPrev) {
if (enc2Down < ENC_TILT_THRESHOLD) {
if (layer_state_is(0)) {
register_code16(KC_MS_WH_DOWN);
}
else if (layer_state_is(1)) {
register_code16(KC_DOWN);
}
}
else {
if (layer_state_is(0)) {
unregister_code16(KC_MS_WH_DOWN);
}
else if (layer_state_is(1)) {
unregister_code16(KC_DOWN);
}
}
}
if (enc2Left != enc2LeftPrev) {
if (enc2Left < ENC_TILT_THRESHOLD) {
if (layer_state_is(1) || layer_state_is(2)) {
register_code16(KC_LEFT);
}
}
else {
if (layer_state_is(1) || layer_state_is(2)) {
unregister_code16(KC_LEFT);
}
}
}
if (enc2Right != enc2RightPrev) {
if (enc2Right < ENC_TILT_THRESHOLD) {
if (layer_state_is(1) || layer_state_is(2)) {
register_code16(KC_RIGHT);
}
}
else {
if (layer_state_is(1) || layer_state_is(2)) {
unregister_code16(KC_RIGHT);
}
}
}
}

View file

@ -8,13 +8,13 @@
{
"a": 7
},
"",
"Ctl+Alt + Tab",
"Right Click",
"Up",
"Left Click"
],
[
"",
"GUI + Down",
"Left",
"Down",
"Right"
@ -23,22 +23,20 @@
{
"y": -0.5,
"x": 4.5,
"a": 4,
"a": 5,
"w": 1.25,
"h": 1.25
},
"\n\n\n\n\n\n&larr;\n&rarr;\n&uarr;\n<i class='fa fa-retweet'></i>\n&darr;"
"Whl Up\nWhl Dn\n\n\n\n\n<i class='fa fa-retweet'></i> Vol"
],
[
{
"y": -0.5
},
"Layer Down",
"Layer Up",
{
"y": -0.5,
"a": 7
},
""
"Layer 0",
"Layer 1",
"Layer 2"
],
[
{
@ -48,6 +46,6 @@
"w": 2,
"h": 2
},
"Mouse Wheel\n\n\n\n\n\n\n\n\n<i class='fa fa-retweet'></i>"
"Esc\n\n\n\n\n\n\n\n\n<i class='fa fa-retweet'></i> Wheel"
]
]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -1,6 +1,6 @@
[
{
"backcolor": "#00f3ff",
"backcolor": "#00ff5a",
"name": "Layer 2 - LR Library",
"author": "KemoNine"
},
@ -61,21 +61,21 @@
[
{
"y": 1,
"w": 2,
"h": 2
},
"Layer Down",
{
"w": 2,
"h": 2
},
"Layer Up",
{
"a": 7,
"w": 2,
"h": 2
},
""
"Layer 0",
{
"w": 2,
"h": 2
},
"Layer 1",
{
"w": 2,
"h": 2
},
"Layer 2"
],
[
{
@ -85,6 +85,6 @@
"w": 4,
"h": 4
},
"Increase/decrease rating by one star\n] / [\n\n\n\n\n<i class='fa fa-retweet'></i>"
"Increase/decrease rating by one star\n] / [\n\n\n\n\n<i class='fa fa-retweet'></i> Esc"
]
]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

View file

@ -1,19 +1,17 @@
[
{
"backcolor": "#00f3ff",
"backcolor": "#fff200",
"name": "Layer 3 - LR Develop",
"author": "KemoNine"
},
[
{
"a": 0,
"f": 5,
"w": 2,
"h": 2
},
"Go to Library module\nCtrl + Alt + 1\n\n\nMOD(1)",
"Go to Library module\nCtrl + Alt + 1",
{
"a": 4,
"w": 2,
"h": 2
},
@ -56,35 +54,35 @@
"w": 3.25,
"h": 3.25
},
"Zoom in\nZoom out\nCtrl + =\nCtrl + -\n\n\n&larr;\n&rarr;\n&uarr;\nSlider Small Increments (+/-)\n&darr;"
"\n\n\n\n\n\n&larr;\n&rarr;\nShift + Up Arrow\n<i class='fa fa-retweet'></i> Slider +/-\nShift + Down Arrow"
],
[
{
"y": 1,
"w": 2,
"h": 2
},
"Flag photo as a reject and go to next photo\nShift + X",
{
"a": 7,
"w": 2,
"h": 2
},
"",
"Layer 0",
{
"w": 2,
"h": 2
},
""
"Layer 1",
{
"w": 2,
"h": 2
},
"Layer 2"
],
[
{
"y": 1,
"x": 6,
"a": 5,
"a": 4,
"w": 4,
"h": 4
},
"Increase/decrease selected slider in larger increments\nShift + Up Arrow / Shift + Down Arrow\n\n\n\n\n<i class='fa fa-retweet'></i>"
"\nCtrl + =\n\nCtrl + -\n\n\n\n\n\n<i class='fa fa-retweet'></i> Esc\nZoom"
]
]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 44 KiB

File diff suppressed because it is too large Load diff

View file

@ -2,3 +2,13 @@
#undef RGBLIGHT_ANIMATIONS
#define RGBLIGHT_LAYERS
#define GRAVE_ESC_CTRL_OVERRIDE
// Mouse settings
#define MOUSEKEY_DELAY 175
#define MOUSEKEY_WHEEL_DELAY 175
#define MOUSEKEY_INTERVAL 20
#define MOUSEKEY_TIME_TO_MAX 15
#define MOUSEKEY_MAX_SPEED 5
#define MOUSEKEY_WHEEL_INTERVAL 50
#define MOUSEKEY_WHEEL_TIME_TO_MAX 20
#define MOUSEKEY_WHEEL_MAX_SPEED 10

View file

@ -24,33 +24,59 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |----------------------------|
*/
[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
LCTL(LALT(KC_TAB)), KC_MS_BTN2, KC_MS_UP, KC_MS_BTN1,
LGUI(KC_DOWN), KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT,
TO(0), TO(1), TO(2)
),
[1] = LAYOUT_Lynepad(
LCTL(LALT(KC_2)), LCTL(KC_BSPACE), LSFT(KC_X), LSFT(KC_P),
LSFT(KC_TAB), KC_G, KC_E, KC_C,
TO(0), TO(1), TO(2)
),
[2] = LAYOUT_Lynepad(
LCTL(LALT(KC_1)), LCTL(KC_LBRACKET), LCTL(KC_RBRACKET), KC_W,
LSFT(KC_TAB), KC_Q, LCTL(LALT(KC_R)), KC_R,
TO(0), TO(1), TO(2)
)
};
// Customized HSV values for layer highlights
#define HSV_KMN_PURPLE 191, 255, 120
#define HSV_KMN_GREEN 85, 255, 120
#define HSV_KMN_YELLOW 43, 255, 120
const rgblight_segment_t PROGMEM led_underglow_purple[] = RGBLIGHT_LAYER_SEGMENTS(
{0, RGBLED_NUM, HSV_KMN_PURPLE}
);
const rgblight_segment_t PROGMEM led_underglow_green[] = RGBLIGHT_LAYER_SEGMENTS(
{0, RGBLED_NUM, HSV_KMN_GREEN}
);
const rgblight_segment_t PROGMEM led_underglow_yellow[] = RGBLIGHT_LAYER_SEGMENTS(
{0, RGBLED_NUM, HSV_KMN_YELLOW}
);
// Array of layers for management
const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(
led_underglow_purple
led_underglow_purple,
led_underglow_green,
led_underglow_yellow
);
// Layer color init
void keyboard_post_init_user(void) {
rgblight_layers = my_rgb_layers;
layer_clear();
layer_on(0);
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));
rgblight_set_layer_state(1, layer_state_cmp(state, 1));
rgblight_set_layer_state(2, layer_state_cmp(state, 2));
return state;
}
@ -59,16 +85,66 @@ void encoder_update_user(uint8_t index, bool clockwise) {
// Process encoder rotational movements
if (index == 0) { /* First encoder */
if (clockwise) {
if (layer_state_is(0)) {
tap_code(KC_MS_WH_UP);
}
else if (layer_state_is(1)) {
tap_code(KC_LBRACKET);
}
else if (layer_state_is(2)) {
register_code16(KC_LCTRL);
register_code16(KC_MINUS);
unregister_code16(KC_MINUS);
unregister_code16(KC_LCTRL);
}
} else {
if (layer_state_is(0)) {
tap_code(KC_MS_WH_DOWN);
}
else if (layer_state_is(1)) {
tap_code(KC_RBRACKET);
}
else if (layer_state_is(2)) {
register_code16(KC_LCTRL);
register_code16(KC_EQUAL);
unregister_code16(KC_EQUAL);
unregister_code16(KC_LCTRL);
}
}
} else if (index == 1) { /* Second encoder */
if (clockwise) {
if (layer_state_is(0)) {
tap_code(KC_AUDIO_VOL_DOWN);
}
else if (layer_state_is(1)) {
register_code16(KC_LCTRL);
register_code16(KC_MINUS);
unregister_code16(KC_MINUS);
unregister_code16(KC_LCTRL);
}
else if (layer_state_is(2)) {
register_code16(KC_LSFT);
register_code16(KC_UP);
unregister_code16(KC_UP);
unregister_code16(KC_LSFT);
}
} else {
if (layer_state_is(0)) {
tap_code(KC_AUDIO_VOL_UP);
}
else if (layer_state_is(1)) {
register_code16(KC_LCTRL);
register_code16(KC_EQUAL);
unregister_code16(KC_EQUAL);
unregister_code16(KC_LCTRL);
}
else if (layer_state_is(2)) {
register_code16(KC_LSFT);
register_code16(KC_DOWN);
unregister_code16(KC_DOWN);
unregister_code16(KC_LSFT);
}
}
}
}
@ -92,16 +168,20 @@ extern int16_t enc2RightPrev;
void matrix_scan_user(void) {
if (enc1Center != enc1CenterPrev) {
if (enc1Center < ENC_TILT_THRESHOLD) {
register_code16(KC_ESC);
}
else {
unregister_code16(KC_ESC);
}
}
if (enc2Center != enc2CenterPrev) {
if (enc2Center < ENC_TILT_THRESHOLD) {
}
else {
if (layer_state_is(0)) {
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
@ -110,30 +190,62 @@ void matrix_scan_user(void) {
}
if (enc2Up != enc2UpPrev) {
if (enc2Up < ENC_TILT_THRESHOLD) {
if (layer_state_is(0)) {
register_code16(KC_MS_WH_UP);
}
else if (layer_state_is(1)) {
register_code16(KC_UP);
}
}
else {
if (layer_state_is(0)) {
unregister_code16(KC_MS_WH_UP);
}
else if (layer_state_is(1)) {
unregister_code16(KC_UP);
}
}
}
if (enc2Down != enc2DownPrev) {
if (enc2Down < ENC_TILT_THRESHOLD) {
if (layer_state_is(0)) {
register_code16(KC_MS_WH_DOWN);
}
else if (layer_state_is(1)) {
register_code16(KC_DOWN);
}
}
else {
if (layer_state_is(0)) {
unregister_code16(KC_MS_WH_DOWN);
}
else if (layer_state_is(1)) {
unregister_code16(KC_DOWN);
}
}
}
if (enc2Left != enc2LeftPrev) {
if (enc2Left < ENC_TILT_THRESHOLD) {
if (layer_state_is(1) || layer_state_is(2)) {
register_code16(KC_LEFT);
}
}
else {
if (layer_state_is(1) || layer_state_is(2)) {
unregister_code16(KC_LEFT);
}
}
}
if (enc2Right != enc2RightPrev) {
if (enc2Right < ENC_TILT_THRESHOLD) {
if (layer_state_is(1) || layer_state_is(2)) {
register_code16(KC_RIGHT);
}
}
else {
if (layer_state_is(1) || layer_state_is(2)) {
unregister_code16(KC_RIGHT);
}
}
}
}