Adding relative movement mouse key support

- Still very basic (lots of room for improvement)
- Capability format will likely change at some point
- 16 bit movement control, however repeat rate limits usability (will need KLL 0.4 to make better)
This commit is contained in:
Jacob Alexander 2016-03-21 22:23:57 -07:00
parent 3c9a97d51a
commit 18aef02a1f
5 changed files with 64 additions and 33 deletions

View file

@ -56,6 +56,14 @@ typedef enum USBKeyChangeState {
USBKeyChangeState_All = 0x7F,
} USBKeyChangeState;
// Allows for selective USB descriptor pushes
// However, in most cases everything is updated for each packet push
typedef enum USBMouseChangeState {
USBMouseChangeState_None = 0x00,
USBMouseChangeState_Buttons = 0x01,
USBMouseChangeState_Relative = 0x02,
} USBMouseChangeState;
// ----- Variables -----
@ -73,13 +81,15 @@ extern uint16_t USBKeys_ConsCtrl; // 1KRO container for Consumer Contro
extern volatile uint8_t USBKeys_Protocol; // 0 - Boot Mode, 1 - NKRO Mode
extern volatile uint16_t USBMouse_Buttons; // Bitmask for mouse buttons
extern volatile uint16_t USBMouse_Relative_x;
extern volatile uint16_t USBMouse_Relative_y;
// Misc variables (XXX Some are only properly utilized using AVR)
extern uint8_t USBKeys_Idle_Config;
extern uint8_t USBKeys_Idle_Count;
extern USBKeyChangeState USBKeys_Changed;
extern uint8_t USBMouse_Changed;
extern USBKeyChangeState USBKeys_Changed;
extern USBMouseChangeState USBMouse_Changed;
extern volatile uint8_t Output_Available; // 0 - Output module not fully functional, 1 - Output module working