MCPcopy Create free account
hub / github.com/SFML/SFML / usageToAxis

Function usageToAxis

src/SFML/Window/FreeBSD/JoystickImpl.cpp:137–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135}
136
137std::optional<sf::Joystick::Axis> usageToAxis(int usage)
138{
139 switch (usage)
140 {
141 case HUG_X:
142 return sf::Joystick::Axis::X;
143 case HUG_Y:
144 return sf::Joystick::Axis::Y;
145 case HUG_Z:
146 return sf::Joystick::Axis::Z;
147 case HUG_RZ:
148 return sf::Joystick::Axis::R;
149 case HUG_RX:
150 return sf::Joystick::Axis::U;
151 case HUG_RY:
152 return sf::Joystick::Axis::V;
153 default:
154 return std::nullopt;
155 }
156}
157
158void hatValueToSfml(int value, sf::priv::JoystickState& state)
159{

Callers 2

getCapabilitiesMethod · 0.70
updateMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected