Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion keyboards/keychron/k1_pro/k1_pro.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,18 @@ void battery_calculte_voltage(uint16_t value) {
battery_set_voltage(voltage);
}

/**
* Default no-op: only exists so via_command_kb()'s default case below has
* something to call regardless of which keymap is being built. A keymap
* that wants to handle raw HID command IDs this board doesn't already
* claim (0xAA/0xAB above) can define its own strong raw_hid_receive_kb()
* to override this weak one — same override convention QMK itself uses
* for via_command_kb().
*/
__attribute__((weak)) bool raw_hid_receive_kb(uint8_t *data, uint8_t length) {
return false;
}

bool via_command_kb(uint8_t *data, uint8_t length) {
switch (data[0]) {
#ifdef KC_BLUETOOTH_ENABLE
Expand All @@ -302,7 +314,7 @@ bool via_command_kb(uint8_t *data, uint8_t length) {
break;
#endif
default:
return false;
return raw_hid_receive_kb(data, length);
}

return true;
Expand Down