载入中...
搜索中...
未找到
Pad.h
浏览该文件的文档.
One connected (or previously connected) joystick / gamepad device. Gamepad axis/button names follow S...
Definition Pad.h:13
SDL joystick/gamepad backend (GameController + optional haptic rumble).
Definition Pad.h:13
void getVibration(float &left, float &right) override
Reads the last requested left/right rumble strengths.
Definition Pad.cpp:322
bool isGamepad() const override
True when a GameController mapping is active for this pad.
Definition Pad.cpp:143
float getGamepadAxis(const std::string &axis) const override
Named gamepad axis value (SDL GameController axis string).
Definition Pad.cpp:147
bool isVibrationSupported() override
True when haptic/rumble output is available.
Definition Pad.cpp:231
bool isConnected() const override
True while the underlying device is still connected.
Definition Pad.cpp:77
bool isGamepadDown(const std::string &button) const override
True if the named gamepad button is pressed.
Definition Pad.cpp:155
std::string getGamepadMappingString() const override
Current SDL GameController mapping string for this device.
Definition Pad.cpp:169
std::string getName() const override
Human-readable device name from the OS/driver.
Definition Pad.cpp:81
bool open(int deviceindex) override
Opens the device by SDL joystick device index.
Definition Pad.cpp:43
std::string getHat(int hatindex) const override
Hat direction string for a hat index (see class brief).
Definition Pad.cpp:112
int getInstanceID() const override
SDL instance id that stays unique while the device is open.
Definition Pad.cpp:194
bool openGamepad(int deviceindex) override
Opens the device as an SDL GameController.
Definition Pad.cpp:131
void getDeviceInfo(int &vendorID, int &productID, int &productVersion) const override
USB/HID vendor, product, and version ids when available.
Definition Pad.cpp:202
void * getHandle() const override
Native handle (SDL_Joystick* / implementation-defined).
Definition Pad.cpp:186
bool isDown(int button) const override
True if the raw button index is currently pressed.
Definition Pad.cpp:117
float getAxis(int axisindex) const override
Normalized axis value in [-1, 1] for a raw axis index.
Definition Pad.cpp:97
Definition EventSink.cpp:21