|
libOpenWinControls
Multiplatform open-source library to interact with the dual-mode controller in GPD devices
|
Controller abstract base class. More...
#include <Controller.h>
Public Member Functions | |
| virtual int | getControllerType () const =0 |
| int value of the controller class version | |
| virtual bool | readConfig ()=0 |
| read the whole configuration | |
| virtual bool | writeConfig () const =0 |
| write the configuration | |
| virtual bool | setButton (Button btn, const std::string &key) const =0 |
set a new key for the button btn | |
| virtual std::string | getButton (Button btn) const =0 |
get the current key of button btn | |
| virtual bool | setBackButton (int num, int slot, const std::string &key) const =0 |
set a new key in slot slot for back button num | |
| virtual std::string | getBackButton (int num, int slot) const =0 |
get the current key in slot slot of back button num | |
| virtual void | setBackButtonStartTime (int num, int slot, int timeMs) const =0 |
set start time for key in slot slot of back button num | |
| virtual int | getBackButtonStartTime (int num, int slot) const =0 |
get start time for key in slot slot of back button num | |
| virtual void | setRumble (RumbleMode mode) const =0 |
| set vibration intensity | |
| virtual RumbleMode | getRumbleMode () const =0 |
| get current vibration intesity | |
| virtual void | setLedMode (LedMode mode) const =0 |
| set led mode | |
| virtual LedMode | getLedMode () const =0 |
| get current led mode | |
| virtual void | setLedColor (int r, int g, int b) const =0 |
| set a custom color for the leds | |
| virtual std::tuple< int, int, int > | getLedColor () const =0 |
| get current led custom color | |
| virtual void | setAnalogCenter (int center, bool left) const =0 |
| set the analog stick offset from center (deadzone) | |
| virtual int | getAnalogCenter (bool left) const =0 |
| get the current analog stick offset from center (deadzone) | |
| virtual void | setAnalogBoundary (int boundary, bool left) const =0 |
| set the analog stick boundary offset (circularity) | |
| virtual int | getAnalogBoundary (bool left) const =0 |
| get the current analog stick boundary offset (circularity) | |
| void | enableLogging (const std::function< void(const std::wstring &)> &logCB) |
| Enable log messages. | |
| bool | init () |
| Initialize the controller. | |
| bool | hasFeature (int feature) const |
Check if feature is enabled for this controller. | |
Controller abstract base class.
|
inline |
Enable log messages.
| logCB | log callback |
|
nodiscardpure virtual |
get the current analog stick boundary offset (circularity)
| left | flag indicating to which analog this setting applies to (left or right) |
Implemented in OWC::ControllerV1, and OWC::ControllerV2.
|
nodiscardpure virtual |
get the current analog stick offset from center (deadzone)
| left | flag indicating to which analog this setting applies to (left or right) |
Implemented in OWC::ControllerV1, and OWC::ControllerV2.
|
nodiscardpure virtual |
get the current key in slot slot of back button num
num is the order of appearance in firmware config
| num | back button number (1,2 ..) |
| slot | back button key slot |
Implemented in OWC::ControllerV1, and OWC::ControllerV2.
|
nodiscardpure virtual |
get start time for key in slot slot of back button num
num is the order of appearance in firmware config
| num | back button number (1,2 ..) |
| slot | back button key slot |
Implemented in OWC::ControllerV1, and OWC::ControllerV2.
|
nodiscardpure virtual |
get the current key of button btn
| btn | the controller button to read |
Implemented in OWC::ControllerV1, and OWC::ControllerV2.
|
nodiscardpure virtual |
int value of the controller class version
Implemented in OWC::ControllerV1, and OWC::ControllerV2.
|
nodiscardpure virtual |
get current led custom color
returned color is valid only when mode is one of LedMode::Solid or LedMode::Breathe
Implemented in OWC::ControllerV1, and OWC::ControllerV2.
|
nodiscardpure virtual |
|
nodiscardpure virtual |
get current vibration intesity
Implemented in OWC::ControllerV1, and OWC::ControllerV2.
|
nodiscard |
Check if feature is enabled for this controller.
| feature | one of ControllerFeature |
|
nodiscard |
Initialize the controller.
Try to find a supported GPD controller and connect to it
|
nodiscardpure virtual |
read the whole configuration
Implemented in OWC::ControllerV1, and OWC::ControllerV2.
|
pure virtual |
set the analog stick boundary offset (circularity)
| boundary | offset |
| left | flag indicating to which analog this setting applies to (left or right) |
Implemented in OWC::ControllerV1, and OWC::ControllerV2.
|
pure virtual |
set the analog stick offset from center (deadzone)
| center | offset |
| left | flag indicating to which analog this setting applies to (left or right) |
Implemented in OWC::ControllerV1, and OWC::ControllerV2.
|
nodiscardpure virtual |
set a new key in slot slot for back button num
num is the order of appearance in firmware config
| num | back button number (1,2, ..) |
| slot | back button key slot |
| key | one of HIDUsageIDMap or XinputUsageIDMap values (case insensitive) |
Implemented in OWC::ControllerV1, and OWC::ControllerV2.
|
pure virtual |
set start time for key in slot slot of back button num
num is the order of appearance in firmware config
| num | back button number (1,2 ..) |
| slot | back button key slot |
| timeMs | start time in milliseconds |
Implemented in OWC::ControllerV1, and OWC::ControllerV2.
|
nodiscardpure virtual |
set a new key for the button btn
| btn | the controller button to remap |
| key | one of HIDUsageIDMap or XinputUsageIDMap values (case insensitive) |
Implemented in OWC::ControllerV1, and OWC::ControllerV2.
|
pure virtual |
set a custom color for the leds
has no effect for modes other than LedMode::Solid and LedMode::Breathe
| r | red value of the color |
| g | green value of the color |
| b | blue value of the color |
Implemented in OWC::ControllerV1, and OWC::ControllerV2.
|
pure virtual |
|
pure virtual |
set vibration intensity
| mode | one of RumbleMode |
Implemented in OWC::ControllerV1, and OWC::ControllerV2.
|
nodiscardpure virtual |
write the configuration
Implemented in OWC::ControllerV1, and OWC::ControllerV2.