MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / lstControlsKeyPress

Method lstControlsKeyPress

src/Menu/OptionsControlsState.cpp:239–255  ·  view source on GitHub ↗

* Change selected control. * @param action Pointer to an action. */

Source from the content-addressed store, hash-verified

237 * @param action Pointer to an action.
238 */
239void OptionsControlsState::lstControlsKeyPress(Action *action)
240{
241 if (_selected != -1)
242 {
243 SDLKey key = action->getDetails()->key.keysym.sym;
244 if (key != 0)
245 {
246 *_selKey->asKey() = key;
247 std::wstring name = Language::utf8ToWstr(ucWords(SDL_GetKeyName(*_selKey->asKey())));
248 _lstControls->setCellText(_selected, 1, name);
249 }
250 _lstControls->setCellColor(_selected, 0, _colorNormal);
251 _lstControls->setCellColor(_selected, 1, _colorNormal);
252 _selected = -1;
253 _selKey = 0;
254 }
255}
256
257}

Callers

nothing calls this directly

Calls 4

getDetailsMethod · 0.80
asKeyMethod · 0.80
setCellTextMethod · 0.80
setCellColorMethod · 0.80

Tested by

no test coverage detected