Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dynamis keyboard #17625

Merged
merged 16 commits into from
Aug 29, 2022
Merged
4 changes: 2 additions & 2 deletions keyboards/bbrfkr/dynamis/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
#include "config_common.h"

/* key matrix */
#define MATRIX_ROWS 10
#define MATRIX_ROWS 11
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#define MATRIX_ROWS 11
#define MATRIX_ROWS 10

#define MATRIX_COLS 7
#define MATRIX_ROW_PINS { B6, B4, D6, D5, D1, C6, B5, D7, D4, D0 }
#define MATRIX_ROW_PINS { B6, B4, D6, D5, D1, C6, B5, D7, D4, D0, NO_PIN }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify, the NO_PIN is there to facilitate encoder in the matrix, correct?

If so, then it needs to be reverted. It's not the proper way to handle this, especially as VIA now supports the encoder map feature.

https://docs.qmk.fm/#/feature_encoders?id=encoder-map

This allows for proper handling of all keycodes, without special cases, and for it be configured dynamically, by VIA

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your comment. But, I cannot find the document that the via support encoder map... So, I don't understand to construct a json file for supporting encoder map feature...

https://www.caniusevia.com/docs/configuring_qmk

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your sharing! I'll try it...

Copy link
Contributor Author

@bbrfkr bbrfkr Aug 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Now, this code supported encoder map.

image

The json for via is the following;

{
    "name": "dynamis",
    "vendorId": "0x6262",
    "productId": "0x0001",
    "lighting": "qmk_rgblight",
    "matrix": {
        "rows": 10,
        "cols": 7
    },
    "layouts": {
        "labels": [
            "ISO Enter",
            "Split Space",
            "Split Left Shift",
            "Split Right Shift",
            "Split Backspace"
        ],
        "keymap": [
            [
                {
                    "x": 15.5
                },
                "5,0\n\n\n4,1",
                "9,0\n\n\n4,1"
            ],
            [
                {
                    "y": 0.25,
                    "x": 2.5
                },
                "0,0",
                "0,1",
                "0,2",
                "0,3",
                "0,4",
                "0,5",
                "0,6",
                "5,6",
                "5,5",
                "5,4",
                "5,3",
                "5,2",
                "5,1",
                {
                    "w": 2
                },
                "5,0\n\n\n4,0"
            ],
            [
                {
                    "x": 2.5,
                    "w": 1.5
                },
                "1,0",
                "1,1",
                "1,2",
                "1,3",
                "1,4",
                "1,5",
                "1,6",
                "6,6",
                "6,5",
                "6,4",
                "6,3",
                "6,2",
                "6,1",
                {
                    "w": 1.5
                },
                "6,0\n\n\n0,0",
                {
                    "x": 4,
                    "w": 1.25,
                    "h": 2,
                    "w2": 1.5,
                    "h2": 1,
                    "x2": -0.25
                },
                "7,0\n\n\n0,1"
            ],
            [
                {
                    "x": 2.5,
                    "w": 1.75
                },
                "2,0",
                "2,1",
                "2,2",
                "2,3",
                "2,4",
                "2,5",
                "2,6",
                "7,6",
                "7,5",
                "7,4",
                "7,3",
                "7,2",
                {
                    "w": 2.25
                },
                "7,0\n\n\n0,0",
                {
                    "x": 3
                },
                "7,1\n\n\n0,1"
            ],
            [
                {
                    "w": 1.25
                },
                "3,0\n\n\n2,1",
                "3,1\n\n\n2,1",
                {
                    "x": 0.25,
                    "w": 2.25
                },
                "3,1\n\n\n2,0",
                "3,2",
                "3,3",
                "3,4",
                "3,5",
                "3,6",
                "8,6",
                "8,5",
                "8,4",
                "8,3",
                "8,2",
                {
                    "w": 2.75
                },
                "8,1\n\n\n3,0",
                {
                    "x": 0.25
                },
                "9,1",
                {
                    "a": 7
                },
                "e0",
                {
                    "x": 0.25,
                    "a": 4,
                    "w": 1.75
                },
                "8,1\n\n\n3,1",
                "8,0\n\n\n3,1"
            ],
            [
                {
                    "x": 2.5,
                    "w": 1.25
                },
                "4,0",
                {
                    "w": 1.25
                },
                "4,1",
                {
                    "w": 1.25
                },
                "4,2",
                {
                    "w": 6.25
                },
                "4,3\n\n\n1,0",
                {
                    "w": 1.25
                },
                "4,6",
                {
                    "w": 1.25
                },
                "9,6",
                {
                    "w": 1.25
                },
                "9,5",
                {
                    "x": 0.5
                },
                "9,4",
                "9,3",
                "9,2"
            ],
            [
                {
                    "y": 0.25,
                    "x": 6.25,
                    "w": 2.25
                },
                "4,3\n\n\n1,1",
                {
                    "w": 1.25
                },
                "4,4\n\n\n1,1",
                {
                    "w": 2.75
                },
                "4,5\n\n\n1,1"
            ]
        ]
    }
}

#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, C7 }

/* rgb num */
Expand Down
16 changes: 6 additions & 10 deletions keyboards/bbrfkr/dynamis/dynamis.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,12 @@

#ifdef ENCODER_ENABLE
bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!encoder_update_user(index, clockwise)) {
return false;
if (!encoder_update_user(index, clockwise)) { return false; }
if (clockwise) {
tap_code(layer_state == 0 ? KC_WH_D : KC_VOLD);
} else {
tap_code(layer_state == 0 ? KC_WH_U : KC_VOLU);
}
if (index == 0) { /* First encoder */
if (clockwise) {
tap_code(KC_WH_D);
} else {
tap_code(KC_WH_U);
}
}
return false;
return true;
drashna marked this conversation as resolved.
Show resolved Hide resolved
}
#endif
6 changes: 4 additions & 2 deletions keyboards/bbrfkr/dynamis/dynamis.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
{ C60, C61, C62, C63, C64, C65, C66 }, \
{ C70, KC_NO, C72, C73, C74, C75, C76 }, \
{ C80, C81, C82, C83, C84, C85, C86 }, \
{ C90, C91, C92, C93, C94, C95, C96 } \
{ C90, C91, C92, C93, C94, C95, C96 }, \
{ KC_WH_D, KC_WH_U, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ C90, C91, C92, C93, C94, C95, C96 }, \
{ KC_WH_D, KC_WH_U, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \
{ C90, C91, C92, C93, C94, C95, C96 } \

}

#define LAYOUT_iso( \
Expand All @@ -55,5 +56,6 @@
{ KC_NO, C61, C62, C63, C64, C65, C66 }, \
{ C70, C71, C72, C73, C74, C75, C76 }, \
{ C80, C81, C82, C83, C84, C85, C86 }, \
{ C90, C91, C92, C93, C94, C95, C96 } \
{ C90, C91, C92, C93, C94, C95, C96 }, \
{ KC_WH_D, KC_WH_U, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ C90, C91, C92, C93, C94, C95, C96 }, \
{ KC_WH_D, KC_WH_U, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \
{ C90, C91, C92, C93, C94, C95, C96 } \

}
76 changes: 38 additions & 38 deletions keyboards/bbrfkr/dynamis/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,62 +17,62 @@
"y": 0
},
{
"label": "F1",
"label": "1",
"x": 1,
"y": 0
},
{
"label": "F2",
"label": "2",
"x": 2,
"y": 0
},
{
"label": "F3",
"label": "3",
"x": 3,
"y": 0
},
{
"label": "F4",
"label": "4",
"x": 4,
"y": 0
},
{
"label": "F5",
"label": "5",
"x": 5,
"y": 0
},
{
"label": "F6",
"label": "6",
"x": 6,
"y": 0
},
{
"label": "F7",
"label": "7",
"x": 7,
"y": 0
},
{
"label": "F8",
"label": "8",
"x": 8,
"y": 0
},
{
"label": "F9",
"label": "9",
"x": 9,
"y": 0
},
{
"label": "F10",
"label": "0",
"x": 10,
"y": 0
},
{
"label": "F11",
"label": "-",
"x": 11,
"y": 0
},
{
"label": "F12",
"label": "=",
"x": 12,
"y": 0
},
Expand Down Expand Up @@ -292,7 +292,7 @@
"w": 1.75
},
{
"label": "Raise",
"label": "Lower",
"x": 14,
"y": 3
},
Expand All @@ -308,13 +308,13 @@
"w": 1.25
},
{
"label": "Super",
"label": "Alt",
"x": 1.25,
"y": 4,
"w": 1.25
},
{
"label": "Alt",
"label": "Lower",
"x": 2.5,
"y": 4,
"w": 1.25
Expand All @@ -326,25 +326,25 @@
"w": 2.25
},
{
"label": "Lower",
"label": "Space",
"x": 6,
"y": 4,
"w": 1.25
},
{
"label": "Raise",
"label": "Enter",
"x": 7.25,
"y": 4,
"w": 2.75
},
{
"label": "Alt",
"label": "Raise",
"x": 10,
"y": 4,
"w": 1.25
},
{
"label": "Super",
"label": "Alt",
"x": 11.25,
"y": 4,
"w": 1.25
Expand Down Expand Up @@ -380,62 +380,62 @@
"y": 0
},
{
"label": "F1",
"label": "1",
"x": 1,
"y": 0
},
{
"label": "F2",
"label": "2",
"x": 2,
"y": 0
},
{
"label": "F3",
"label": "3",
"x": 3,
"y": 0
},
{
"label": "F4",
"label": "4",
"x": 4,
"y": 0
},
{
"label": "F5",
"label": "5",
"x": 5,
"y": 0
},
{
"label": "F6",
"label": "6",
"x": 6,
"y": 0
},
{
"label": "F7",
"label": "7",
"x": 7,
"y": 0
},
{
"label": "F8",
"label": "8",
"x": 8,
"y": 0
},
{
"label": "F9",
"label": "9",
"x": 9,
"y": 0
},
{
"label": "F10",
"label": "0",
"x": 10,
"y": 0
},
{
"label": "F11",
"label": "-",
"x": 11,
"y": 0
},
{
"label": "F12",
"label": "=",
"x": 12,
"y": 0
},
Expand Down Expand Up @@ -655,7 +655,7 @@
"w": 1.75
},
{
"label": "Raise",
"label": "Lower",
"x": 14,
"y": 3
},
Expand All @@ -671,13 +671,13 @@
"w": 1.25
},
{
"label": "Super",
"label": "Alt",
"x": 1.25,
"y": 4,
"w": 1.25
},
{
"label": "Alt",
"label": "Lower",
"x": 2.5,
"y": 4,
"w": 1.25
Expand All @@ -689,25 +689,25 @@
"w": 2.25
},
{
"label": "Lower",
"label": "Space",
"x": 6,
"y": 4,
"w": 1.25
},
{
"label": "Raise",
"label": "Enter",
"x": 7.25,
"y": 4,
"w": 2.75
},
{
"label": "Alt",
"label": "Raise",
"x": 10,
"y": 4,
"w": 1.25
},
{
"label": "Super",
"label": "Alt",
"x": 11.25,
"y": 4,
"w": 1.25
Expand Down
40 changes: 20 additions & 20 deletions keyboards/bbrfkr/dynamis/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,40 +20,40 @@ enum layer_names {
_QWERTY,
_LOWER,
_RAISE,
_SETTINGS
_SETTINGS,
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

[_QWERTY] = LAYOUT_ansi(
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC, KC_DEL,
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
KC_TAB, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(2), KC_UP,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), MO(2), KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
KC_TAB, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), KC_UP,
KC_LCTL, KC_LALT, MO(1), KC_SPC, KC_SPC, KC_ENT, MO(2), KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
),

[_LOWER] = LAYOUT_ansi(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, KC_TRNS, KC_TRNS,
KC_PSCR, KC_TRNS, KC_TRNS, KC_WH_U, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_BTN3, KC_BTN2, KC_WH_D, KC_BTN1, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END, KC_TRNS, KC_TRNS, MO(3), KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_PSCR, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_BTN3, KC_BTN2, KC_BTN1, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_LGUI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(3), KC_RGUI, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE
),

[_RAISE] = LAYOUT_ansi(
KC_ESC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_TRNS,
KC_TRNS, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_QUOT, KC_LBRC, KC_RBRC, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_UNDS, KC_PLUS, KC_DQUO, KC_LCBR, KC_RCBR, KC_TRNS, MO(3), KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_PSCR, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_LGUI, MO(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_RGUI, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE
),

[_SETTINGS] = LAYOUT_ansi(
QK_BOOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, RGB_RMOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
)
QK_BOOT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
KC_NO, RGB_TOG, RGB_MOD, RGB_RMOD, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO
),
};
Loading