Closed bilogic closed 5 years ago
The mouse_q in my implementation needs to receive a uint8_t array with length HID_MOUSE_IN_RPT_LEN
and not the mouse command struct.
Have a look at r_encoder.c
where I implemented usage of mouse commands (I think the cases are pretty self explanatory) and modify your function accordingly:
Thanks for info, I eventually got this to work with https://github.com/Galzai/MK32
typedef struct mouse_command
{
uint8_t buttons; // mouse_state[0]
int8_t x; // mouse_state[1]
int8_t y; // mouse_state[2]
int8_t wheel; // mouse_state[3]
} mouse_command_t;
The clue was from here, https://github.com/asterics/esp32_mouse_keyboard/blob/625440c04d0536783f51585b9161a9ae42c24686/components/nkolban_BLE/HID_kbdmousejoystick.cpp#L340-L358
It was confusing why the mouse_command_t
had a different field order:
https://github.com/asterics/esp32_mouse_keyboard/blob/625440c04d0536783f51585b9161a9ae42c24686/components/nkolban_BLE/HID_kbdmousejoystick.h#L97-L104
Hi,
I copied the function
uart_console
from https://github.com/asterics/esp32_mouse_keyboard to try sending mouse commands from the serial monitor.However, the keys "a" and "d" does nothing (i.e. does not move left/right) while "w" and "s" moves the cursor left and right ("w" is supposed to move up and "s" supposed to move down).
Any one can spot where I gone wrong? Thank you.