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

Method initialize

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

///////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

167{
168////////////////////////////////////////////////////////////
169void JoystickImpl::initialize()
170{
171 hid_init(nullptr);
172
173 // Do an initial scan
174 updatePluggedList();
175
176 // Map of hat values
177 hatValueMap[0] = std::make_pair(0, 0); // center
178
179 hatValueMap[1] = std::make_pair(0, -100); // top
180 hatValueMap[3] = std::make_pair(100, 0); // right
181 hatValueMap[5] = std::make_pair(0, 100); // bottom
182 hatValueMap[7] = std::make_pair(-100, 0); // left
183
184 hatValueMap[2] = std::make_pair(100, -100); // top-right
185 hatValueMap[4] = std::make_pair(100, 100); // bottom-right
186 hatValueMap[6] = std::make_pair(-100, 100); // bottom-left
187 hatValueMap[8] = std::make_pair(-100, -100); // top-left
188}
189
190
191////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 1

updatePluggedListFunction · 0.70

Tested by

no test coverage detected