Add mouse button 3, mouse wheel left/right to qvex lyne pad kemonine profile

This commit is contained in:
kemonine 2020-11-08 23:52:13 -05:00
parent c2906f4b63
commit 211a510401
4 changed files with 39 additions and 15 deletions

View file

@ -26,7 +26,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_Lynepad(
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)
KC_MS_BTN3, TO(1), TO(2)
),
[1] = LAYOUT_Lynepad(
LCTL(LALT(KC_2)), LCTL(KC_BSPACE), LSFT(KC_X), LSFT(KC_P),
@ -226,24 +226,36 @@ void matrix_scan_user(void) {
}
if (enc2Left != enc2LeftPrev) {
if (enc2Left < ENC_TILT_THRESHOLD) {
if (layer_state_is(1) || layer_state_is(2)) {
if (layer_state_is(0)) {
register_code16(KC_MS_WH_LEFT);
}
else if (layer_state_is(1) || layer_state_is(2)) {
register_code16(KC_LEFT);
}
}
else {
if (layer_state_is(1) || layer_state_is(2)) {
if (layer_state_is(0)) {
unregister_code16(KC_MS_WH_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)) {
if (layer_state_is(0)) {
register_code16(KC_MS_WH_RIGHT);
}
else if (layer_state_is(1) || layer_state_is(2)) {
register_code16(KC_RIGHT);
}
}
else {
if (layer_state_is(1) || layer_state_is(2)) {
if (layer_state_is(0)) {
unregister_code16(KC_MS_WH_RIGHT);
}
else if (layer_state_is(1) || layer_state_is(2)) {
unregister_code16(KC_RIGHT);
}
}

View file

@ -23,18 +23,18 @@
{
"y": -0.5,
"x": 4.5,
"a": 5,
"w": 1.25,
"h": 1.25
"a": 4,
"w": 2.5,
"h": 2
},
"Whl Up\nWhl Dn\n\n\n\n\n<i class='fa fa-retweet'></i> Vol"
"\n\n\n\n\n\nWhl Lft\nWhl Rt\nWhl Up\n<i class='fa fa-retweet'></i> Vol\nWhl Dn"
],
[
{
"y": -0.5,
"a": 7
},
"Layer 0",
"Mouse Btn 3",
"Layer 1",
"Layer 2"
],

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View file

@ -26,7 +26,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_Lynepad(
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)
KC_MS_BTN3, TO(1), TO(2)
),
[1] = LAYOUT_Lynepad(
LCTL(LALT(KC_2)), LCTL(KC_BSPACE), LSFT(KC_X), LSFT(KC_P),
@ -226,24 +226,36 @@ void matrix_scan_user(void) {
}
if (enc2Left != enc2LeftPrev) {
if (enc2Left < ENC_TILT_THRESHOLD) {
if (layer_state_is(1) || layer_state_is(2)) {
if (layer_state_is(0)) {
register_code16(KC_MS_WH_LEFT);
}
else if (layer_state_is(1) || layer_state_is(2)) {
register_code16(KC_LEFT);
}
}
else {
if (layer_state_is(1) || layer_state_is(2)) {
if (layer_state_is(0)) {
unregister_code16(KC_MS_WH_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)) {
if (layer_state_is(0)) {
register_code16(KC_MS_WH_RIGHT);
}
else if (layer_state_is(1) || layer_state_is(2)) {
register_code16(KC_RIGHT);
}
}
else {
if (layer_state_is(1) || layer_state_is(2)) {
if (layer_state_is(0)) {
unregister_code16(KC_MS_WH_RIGHT);
}
else if (layer_state_is(1) || layer_state_is(2)) {
unregister_code16(KC_RIGHT);
}
}