For pulsed buttons, implement per-button 'timers' that independently end the pulse instead of having a 250ms delay between every single update...
This commit is contained in:
parent
3b69b7e960
commit
1a4916fd0e
4 changed files with 43 additions and 25 deletions
|
@ -58,13 +58,11 @@ class Joystick {
|
|||
void ReleaseAllButtons();
|
||||
void Write();
|
||||
|
||||
void _ReleasePulsedButtons();
|
||||
void _UpdateAxis(uint8_t index);
|
||||
|
||||
Button* _buttons[JOYSTICK_NUM_BUTTONS];
|
||||
uint8_t _num_buttons;
|
||||
uint8_t _virtual_buttons; // a single user-defined button can have multiple virtual buttons.
|
||||
bool _have_pulsed_button;
|
||||
|
||||
uint8_t _axes[JOYSTICK_NUM_AXES];
|
||||
uint8_t _num_axes;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue