back up of work during May 2019
Dependencies: microbit
KeyBuffer Class Reference
Buffer used to store keys to send. More...
#include <KeyboardService.h>
Public Member Functions | |
void | setPending (uint8_t data) |
Mark a character as pending. | |
bool | getPending (uint8_t &data) |
Get pending char. | |
void | setKeyUpPending (void) |
Signal that a keyUp report is pending. | |
void | clearKeyUpPending (void) |
Signal that no high-priority report is pending anymore, we can go back to the normal queue. |
Detailed Description
Buffer used to store keys to send.
Internally, it is a CircularBuffer, with the added capability of putting the last char back in, when we're unable to send it (ie. when BLE stack is busy)
Definition at line 85 of file KeyboardService.h.
Member Function Documentation
void clearKeyUpPending | ( | void | ) |
Signal that no high-priority report is pending anymore, we can go back to the normal queue.
Definition at line 147 of file KeyboardService.h.
bool getPending | ( | uint8_t & | data ) |
Get pending char.
Either from the high priority buffer (set with setPending), or from the circular buffer.
- Parameters:
-
data Filled with the pending data, when present
- Returns:
- true if data was filled
Definition at line 118 of file KeyboardService.h.
void setKeyUpPending | ( | void | ) |
Signal that a keyUp report is pending.
This means that a character has successfully been sent, but the subsequent keyUp report failed. This report is of highest priority than the next character.
Definition at line 139 of file KeyboardService.h.
void setPending | ( | uint8_t | data ) |
Mark a character as pending.
When a freshly popped character cannot be sent, because the underlying stack is busy, we set it as pending, and it will get popped in priority by getPending once reports can be sent again.
- Parameters:
-
data The character to send in priority. The second keyUp report is implied.
Definition at line 102 of file KeyboardService.h.
Generated on Mon Jul 18 2022 14:25:12 by 1.7.2