add interface
This commit is contained in:
@@ -64,6 +64,19 @@ void SwitchControlLibrary_::SendReport()
|
|||||||
CustomHID().SendReport(&_joystickInputData, sizeof(USB_JoystickReport_Input_t));
|
CustomHID().SendReport(&_joystickInputData, sizeof(USB_JoystickReport_Input_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SwitchControlLibrary_::PressButton(Button b)
|
||||||
|
{
|
||||||
|
_joystickInputData.Button |= (uint16_t)b;
|
||||||
|
SendReport();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SwitchControlLibrary_::ReleaseButton(Button b)
|
||||||
|
{
|
||||||
|
_joystickInputData.Button &= ((uint16_t)b ^ 0xffff);
|
||||||
|
SendReport();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void SwitchControlLibrary_::PressButtonY()
|
void SwitchControlLibrary_::PressButtonY()
|
||||||
{
|
{
|
||||||
_joystickInputData.Button |= (uint16_t)Button::Y;
|
_joystickInputData.Button |= (uint16_t)Button::Y;
|
||||||
|
|||||||
@@ -61,6 +61,9 @@ class SwitchControlLibrary_
|
|||||||
public:
|
public:
|
||||||
SwitchControlLibrary_();
|
SwitchControlLibrary_();
|
||||||
|
|
||||||
|
void PressButton(Button b);
|
||||||
|
void ReleaseButton(Button b);
|
||||||
|
|
||||||
void PressButtonY();
|
void PressButtonY();
|
||||||
void ReleaseButtonY();
|
void ReleaseButtonY();
|
||||||
void PressButtonB();
|
void PressButtonB();
|
||||||
|
|||||||
Reference in New Issue
Block a user