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

Method initialize

src/SFML/Window/NetBSD/JoystickImpl.cpp:170–189  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

updatePluggedListFunction · 0.70

Tested by

no test coverage detected