-
Notifications
You must be signed in to change notification settings - Fork 29
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
Conversation
c55cd51
to
fbdb415
Compare
@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. |
There was a problem hiding this 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?
src/actions/hid.action.ts
Outdated
// 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, | ||
}) | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// 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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sekigon-gonnoc LGTM.
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.