Implement connection keycode logic (#25176)

This commit is contained in:
Joel Challis 2025-04-21 22:27:56 +01:00 committed by GitHub
parent ec324af22e
commit c7cb7ba976
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 347 additions and 99 deletions

View file

@ -31,8 +31,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#endif
#ifdef BLUETOOTH_ENABLE
# ifndef CONNECTION_ENABLE
# error CONNECTION_ENABLE required and not enabled
# endif
# include "connection.h"
# include "bluetooth.h"
# include "outputselect.h"
#endif
#ifdef NKRO_ENABLE
@ -74,7 +77,7 @@ led_t host_keyboard_led_state(void) {
/* send report */
void host_keyboard_send(report_keyboard_t *report) {
#ifdef BLUETOOTH_ENABLE
if (where_to_send() == OUTPUT_BLUETOOTH) {
if (connection_get_host() == CONNECTION_HOST_BLUETOOTH) {
bluetooth_send_keyboard(report);
return;
}
@ -111,7 +114,7 @@ void host_nkro_send(report_nkro_t *report) {
void host_mouse_send(report_mouse_t *report) {
#ifdef BLUETOOTH_ENABLE
if (where_to_send() == OUTPUT_BLUETOOTH) {
if (connection_get_host() == CONNECTION_HOST_BLUETOOTH) {
bluetooth_send_mouse(report);
return;
}
@ -147,7 +150,7 @@ void host_consumer_send(uint16_t usage) {
last_consumer_usage = usage;
#ifdef BLUETOOTH_ENABLE
if (where_to_send() == OUTPUT_BLUETOOTH) {
if (connection_get_host() == CONNECTION_HOST_BLUETOOTH) {
bluetooth_send_consumer(usage);
return;
}