载入中...
搜索中...
未找到
Joystick.cpp
浏览该文件的文档.
Joystick / gamepad manager. Tracks connected pads and gamecontroller mappings.
Definition Joystick.h:14
virtual int getJoystickCount() const =0
Number of currently tracked pads.
virtual std::string saveGamepadMappings()=0
Serializes the in-memory GameController mapping database.
virtual void removeJoystick(Pad *pad)=0
Removes and destroys a previously opened pad.
virtual Pad * getJoystickFromID(int instanceid)=0
Looks up a pad by SDL instance id; null if unknown.
virtual void loadGamepadMappings(const std::string &mappings)=0
Load SDL GameController mapping database (newline-separated).
virtual std::string getGamepadMappingString(const std::string &guid) const =0
Mapping string for a device GUID, or empty if none.
virtual int getIndex(const Pad *pad)=0
Dense index of pad, or -1 if not tracked.
virtual Pad * getJoystick(int joyindex)=0
Pad at a dense joyindex in [0, getJoystickCount()).
virtual Pad * addJoystick(int deviceindex)=0
Open a device by SDL device index; returns null on failure.
virtual bool isDown(int button) const =0
True if the raw button index is currently pressed.
virtual std::string getGamepadMappingString() const =0
Current SDL GameController mapping string for this device.
virtual bool isGamepadDown(const std::string &button) const =0
True if the named gamepad button is pressed.
virtual bool isVibrationSupported()=0
True when haptic/rumble output is available.
virtual float getAxis(int axisindex) const =0
Normalized axis value in [-1, 1] for a raw axis index.
virtual int getButtonCount() const =0
Number of raw joystick buttons.
virtual float getGamepadAxis(const std::string &axis) const =0
Named gamepad axis value (SDL GameController axis string).
virtual std::string getHat(int hatindex) const =0
Hat direction string for a hat index (see class brief).
virtual std::string getGUID() const =0
Stable GUID string for mapping lookup.
virtual int getID() const =0
Engine-side stable pad id assigned at construction.
virtual std::vector< float > getAxes() const =0
Snapshot of all raw axis values.
virtual std::string getName() const =0
Human-readable device name from the OS/driver.
virtual bool isGamepad() const =0
True when a GameController mapping is active for this pad.
virtual int getInstanceID() const =0
SDL instance id that stays unique while the device is open.
SDL joystick/gamepad module backend (device enumeration and mappings).
Definition Joystick.h:14
Definition Joystick.cpp:8