Added special char cmd
This commit is contained in:
@ -102,6 +102,17 @@ void _hid_send_state(_hid_send_state_args args) {
|
||||
}
|
||||
|
||||
|
||||
void hid_send_special_char(uint16_t char_id) {
|
||||
uint8_t packet[RAW_EPSIZE] = {
|
||||
CMD_SPECIAL_CHAR,
|
||||
(char_id >> 0) & 0xFF,
|
||||
(char_id >> 8) & 0xFF
|
||||
};
|
||||
|
||||
raw_hid_send(packet, RAW_EPSIZE);
|
||||
}
|
||||
|
||||
|
||||
#ifdef BETA_ENABLE_SPELLCHECK
|
||||
void hid_send_word() {
|
||||
uint8_t packet[RAW_EPSIZE] = {
|
||||
|
@ -19,6 +19,8 @@ void _hid_send_state(_hid_send_state_args args);
|
||||
)
|
||||
|
||||
|
||||
void hid_send_special_char(uint16_t char_utf_8);
|
||||
|
||||
#ifdef BETA_ENABLE_SPELLCHECK
|
||||
void hid_send_word(void);
|
||||
#endif
|
||||
|
@ -1,5 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
|
||||
|
||||
// Sent by host when connection is initiated.
|
||||
//
|
||||
// Packet structure:
|
||||
@ -7,6 +10,9 @@
|
||||
// # of Bytes: | 1 |
|
||||
#define CMD_HELLO 0x00
|
||||
|
||||
|
||||
|
||||
|
||||
// Sent periodically by host to test connection.
|
||||
// Keyboard should ignore this command.
|
||||
//
|
||||
@ -15,6 +21,9 @@
|
||||
// # of Bytes: | 1 |
|
||||
#define CMD_RUTHERE 0x01
|
||||
|
||||
|
||||
|
||||
|
||||
// Send keyboard state to host.
|
||||
//
|
||||
// Packet structure:
|
||||
@ -40,23 +49,7 @@
|
||||
#define CMD_SEND_STATE 0x02
|
||||
|
||||
|
||||
// Sent by keyboard to host when a complete word is typed.
|
||||
// Host checks if this is a known word.
|
||||
// If it is not, host responds with the same CMD (see below).
|
||||
//
|
||||
// Packet structure (sent by keyboard):
|
||||
// Data: | cmd | word length | keycodes |
|
||||
// # of Bytes: | 1 | 1 | ? |
|
||||
//
|
||||
// word length: number of bytes in `keycodes` block
|
||||
//
|
||||
//
|
||||
// Packet structure (sent by host):
|
||||
// Data: | cmd | typo? |
|
||||
// # of Bytes: | 1 | 1 |
|
||||
//
|
||||
// typo: If this is 0x01, the word we got was a typo.
|
||||
#define CMD_SPELLCHECK_WORD 0x04
|
||||
|
||||
|
||||
// Animation data. Sent by host.
|
||||
//
|
||||
@ -76,3 +69,38 @@
|
||||
// Minimum height is 0, maximum is 250.
|
||||
#define CMD_ANIM_DATA_fft 0x00
|
||||
|
||||
|
||||
|
||||
|
||||
// Sent by keyboard to host when a complete word is typed.
|
||||
// Host checks if this is a known word.
|
||||
// If it is not, host responds with the same CMD (see below).
|
||||
//
|
||||
// Packet structure (sent by keyboard):
|
||||
// Data: | cmd | word length | keycodes |
|
||||
// # of Bytes: | 1 | 1 | ? |
|
||||
//
|
||||
// word length: number of bytes in `keycodes` block
|
||||
//
|
||||
//
|
||||
// Packet structure (sent by host):
|
||||
// Data: | cmd | typo? |
|
||||
// # of Bytes: | 1 | 1 |
|
||||
//
|
||||
// typo: If this is 0x01, the word we got was a typo.
|
||||
#define CMD_SPELLCHECK_WORD 0x04
|
||||
|
||||
|
||||
|
||||
|
||||
// Sent by host when a "special char" key is pressed.
|
||||
// Handled by host interface.
|
||||
//
|
||||
// Packet structure:
|
||||
// Data: | cmd | character |
|
||||
// # of Bytes: | 1 | 2 |
|
||||
//
|
||||
// character:
|
||||
// uint16_t, character id
|
||||
//
|
||||
#define CMD_SPECIAL_CHAR 0x05
|
Reference in New Issue
Block a user