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 ble micro pro custom keycodes #772

Merged
merged 5 commits into from
Nov 12, 2023

Conversation

sekigon-gonnoc
Copy link
Contributor

@sekigon-gonnoc sekigon-gonnoc commented Nov 2, 2023

This pull request includes two main updates: a keycode update for BLE Micro Pro and a revision to the user custom keycode composition logic. I am preparing to release a new firmware for BLE Micro Pro that will support the latest REMAP feature. In this upcoming version, the values of custom keycodes for BLE Micro Pro will be replaced, starting from QK_KB_0. Furthermore, the custom keycode definition will also be overridden.

Please note that BMP keycodes are only enabled when a connected keyboard utilizes BMP. This means that this modification won't have any adverse effects on keyboards operating on different platforms.

@sekigon-gonnoc sekigon-gonnoc marked this pull request as draft November 2, 2023 11:49
@sekigon-gonnoc sekigon-gonnoc marked this pull request as ready for review November 2, 2023 14:04
@yoichiro
Copy link
Collaborator

yoichiro commented Nov 4, 2023

@sekigon-gonnoc Thank you for submitting this pull request! OK, I intend to review this as soon as possible. Probably I will review this next week.

Copy link
Collaborator

@yoichiro yoichiro left a comment

Choose a reason for hiding this comment

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

@sekigon-gonnoc Thank you for submitting this pull request. I posted a comment. Could you confirm and address it?

Comment on lines 299 to 318
// Override custom keycode list if the keyboard uses BLE Micro Pro
const customKeycodes = !isBleMicroPro
? entities.keyboardDefinition?.customKeycodes
: bmpKeyInfoList.map((k) => {
return {
name: k.keycodeInfo.label,
title: k.desc,
shortName: k.keycodeInfo.name.short,
};
});

if (isBleMicroPro) {
dispatch(HidActions.updateBleMicroPro(isBleMicroPro));
dispatch(
StorageActions.updateKeyboardDefinition({
...entities.keyboardDefinition,
customKeycodes: customKeycodes,
})
);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// Override custom keycode list if the keyboard uses BLE Micro Pro
const customKeycodes = !isBleMicroPro
? entities.keyboardDefinition?.customKeycodes
: bmpKeyInfoList.map((k) => {
return {
name: k.keycodeInfo.label,
title: k.desc,
shortName: k.keycodeInfo.name.short,
};
});
if (isBleMicroPro) {
dispatch(HidActions.updateBleMicroPro(isBleMicroPro));
dispatch(
StorageActions.updateKeyboardDefinition({
...entities.keyboardDefinition,
customKeycodes: customKeycodes,
})
);
}
dispatch(HidActions.updateBleMicroPro(isBleMicroPro));
// Override custom keycode list if the keyboard uses BLE Micro Pro
const customKeycodes = !isBleMicroPro
? entities.keyboardDefinition?.customKeycodes
: bmpKeyInfoList.map((k) => {
return {
name: k.keycodeInfo.label,
title: k.desc,
shortName: k.keycodeInfo.name.short,
};
});
if (isBleMicroPro) {
dispatch(
StorageActions.updateKeyboardDefinition({
...entities.keyboardDefinition,
customKeycodes: customKeycodes,
})
);
}

@sekigon-gonnoc In the diff you have created, the HidActions.updateBleMicroPro() function is called only when the isBleMicroPro is true. If a user connects a keyboard with BMP, the keyboard is disconnected and then other keyboard using other MCU (not BMP) is connected, the bleMicroPro flag is still true. That is, the BMP feature will be shown on Remap for the keyboard which BMP is not used, I guess. Could you modify the code so that the updateBleMicroPro function is called regardless of the isBleMicroPro value?

Copy link
Collaborator

@yoichiro yoichiro left a comment

Choose a reason for hiding this comment

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

@yoichiro yoichiro merged commit 434cb30 into remap-keys:main Nov 12, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants