(*driver->send_keyboard)(report);
if (debug_keyboard) {
- print("keys: ");
+ dprint("keys: ");
for (int i = 0; i < REPORT_KEYS; i++) {
- phex(keyboard_report->keys[i]); print(" ");
+ dprintf("%02X ", keyboard_report->keys[i]);
}
- print(" mods: "); phex(keyboard_report->mods); print("\n");
+ dprintf(" mods: %02X\n", keyboard_report->mods);
}
}
}
}
-void host_add_mod_bit(uint8_t mod)
+uint8_t host_get_mods(void)
{
- keyboard_report->mods |= mod;
+ return keyboard_report->mods;
}
-void host_del_mod_bit(uint8_t mod)
+void host_add_mods(uint8_t mods)
{
- keyboard_report->mods &= ~mod;
+ keyboard_report->mods |= mods;
+}
+
+void host_del_mods(uint8_t mods)
+{
+ keyboard_report->mods &= ~mods;
}
void host_set_mods(uint8_t mods)
if ((code>>3) < REPORT_KEYS) {
keyboard_report->keys[code>>3] |= 1<<(code&7);
} else {
- debug("add_key_bit: can't add: "); phex(code); debug("\n");
+ dprintf("add_key_bit: can't add: %02X\n", code);
}
}
if ((code>>3) < REPORT_KEYS) {
keyboard_report->keys[code>>3] &= ~(1<<(code&7));
} else {
- debug("del_key_bit: can't del: "); phex(code); debug("\n");
+ dprintf("del_key_bit: can't del: %02X\n", code);
}
}