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

Update dynamis keyboard #17625

merged 16 commits into from
Aug 29, 2022

Conversation

bbrfkr
Copy link
Contributor

@bbrfkr bbrfkr commented Jul 11, 2022

Description

I updated the code of dynamis keyboard. In this work, the changes are the following:

  • support remapping encoder
  • update default keymap
  • update readme

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • [] My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@github-actions github-actions bot added keyboard keymap via Adds via keymap and/or updates keyboard for via support labels Jul 11, 2022
@bbrfkr
Copy link
Contributor Author

bbrfkr commented Jul 11, 2022

@drashna Could you check my PR?

@keyboard-magpie
Copy link
Contributor

These appear to be relatively significant changes to the matrix; does this represent new hardware that should in fact be managed in a rev2 folder?

@drashna
Copy link
Member

drashna commented Jul 11, 2022

@drashna Could you check my PR?

This PR is 4 hours old, and has not been reviewed at all, yet. There is no need to tag me, at this point.

In this context, this sort of ping is actually quite rude.

Pull Request reviews are something that is done in our free time. We are not paid nor compensated for the time we spend reviewing, as it is a labor of love. As such, this means that it can take time for us to get to your Pull Request. Things like family, or life can get in the way of us getting to PRs, and burnout is a serious consideration. The QMK firmware repository averages 200 PRs opened and 200 PRs merged every month, so please have patience.

And to be clear, I'm not angry here, but this is behavior that we want to nip in the bud before it becomes a problem.

keyboards/bbrfkr/dynamis/dynamis.c Outdated Show resolved Hide resolved
keyboards/bbrfkr/dynamis/dynamis.h Outdated Show resolved Hide resolved
keyboards/bbrfkr/dynamis/readme.md Outdated Show resolved Hide resolved
keyboards/bbrfkr/dynamis/dynamis.c Outdated Show resolved Hide resolved
@bbrfkr
Copy link
Contributor Author

bbrfkr commented Jul 11, 2022

Dear drashna,

I apologize for my rude behavior. I mistaked the usage of @ tag...
I swear it will never happen again.

Thank you for pointing it out.

@bbrfkr
Copy link
Contributor Author

bbrfkr commented Jul 12, 2022

These appear to be relatively significant changes to the matrix; does this represent new hardware that should in fact be managed in a rev2 folder?

No. This code is newly version firmware of dynamis keyboard, and support the same hardware.

@drashna
Copy link
Member

drashna commented Jul 12, 2022

Dear drashna,

I apologize for my rude behavior. I mistaked the usage of @ tag... I swear it will never happen again.

Thank you for pointing it out.

No worries. If it's been ... a while (eg, weeks), that's fine. Also, if you exclude the "@", it won't tag that user.

Eg, tagging a user is for getting their attention, but in this case, there is no need to get my attention (it's new, so I'll definitely see it when I go through PRs)

keyboards/bbrfkr/dynamis/dynamis.c Outdated Show resolved Hide resolved
keyboards/bbrfkr/dynamis/dynamis.c Show resolved Hide resolved
Comment on lines 38 to 39
{ 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 } \

Comment on lines 59 to 60
{ 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 } \

@@ -26,9 +26,9 @@
#define PRODUCT dynamis

/* 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, D2 }
Copy link
Member

Choose a reason for hiding this comment

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

Is D2 actually being used here? Or just being used as a place holder?

Suggested change
#define MATRIX_ROW_PINS { B6, B4, D6, D5, D1, C6, B5, D7, D4, D0, D2 }
#define MATRIX_ROW_PINS { B6, B4, D6, D5, D1, C6, B5, D7, D4, D0 }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

D2 is for the encoder. I think that the default via keymap for encoder cannot be defined if this doesn't exist.

Copy link
Member

Choose a reason for hiding this comment

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

You can undefine and redefine the values for the via keymap, actually.

Which is the ideal option here, since you're creating blank spots in the layout that are ONLY used for the encoders.

Also, you should use NO_PIN instead of assigning a pin here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see. I replaced D2 to NO_PIN.

@bbrfkr
Copy link
Contributor Author

bbrfkr commented Aug 11, 2022

I didn't notice that this pr conflicted. The conflict has been resolved.

Comment on lines 61 to 96
keyevent_t encoder_ccw = {
.key = (keypos_t){.row = 10, .col = 1},
.pressed = false
};

keyevent_t encoder_cw = {
.key = (keypos_t){.row = 10, .col = 0},
.pressed = false
};

void matrix_scan_user(void) {
if (IS_PRESSED(encoder_ccw)) {
encoder_ccw.pressed = false;
encoder_ccw.time = (timer_read() | 1);
action_exec(encoder_ccw);
}

if (IS_PRESSED(encoder_cw)) {
encoder_cw.pressed = false;
encoder_cw.time = (timer_read() | 1);
action_exec(encoder_cw);
}
}

bool encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
encoder_cw.pressed = true;
encoder_cw.time = (timer_read() | 1);
action_exec(encoder_cw);
} else {
encoder_ccw.pressed = true;
encoder_ccw.time = (timer_read() | 1);
action_exec(encoder_ccw);
}
return false;
}
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
keyevent_t encoder_ccw = {
.key = (keypos_t){.row = 10, .col = 1},
.pressed = false
};
keyevent_t encoder_cw = {
.key = (keypos_t){.row = 10, .col = 0},
.pressed = false
};
void matrix_scan_user(void) {
if (IS_PRESSED(encoder_ccw)) {
encoder_ccw.pressed = false;
encoder_ccw.time = (timer_read() | 1);
action_exec(encoder_ccw);
}
if (IS_PRESSED(encoder_cw)) {
encoder_cw.pressed = false;
encoder_cw.time = (timer_read() | 1);
action_exec(encoder_cw);
}
}
bool encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
encoder_cw.pressed = true;
encoder_cw.time = (timer_read() | 1);
action_exec(encoder_cw);
} else {
encoder_ccw.pressed = true;
encoder_ccw.time = (timer_read() | 1);
action_exec(encoder_ccw);
}
return false;
}

#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"
            ]
        ]
    }
}

@drashna drashna requested a review from a team August 28, 2022 22:11
@drashna drashna merged commit a2294bc into qmk:master Aug 29, 2022
@bbrfkr
Copy link
Contributor Author

bbrfkr commented Aug 29, 2022

Thank you for your review!

nolanseaton pushed a commit to nolanseaton/qmk_firmware that referenced this pull request Jan 23, 2023
Co-authored-by: Drashna Jaelre <drashna@live.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keyboard keymap via Adds via keymap and/or updates keyboard for via support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants