MCPcopy Create free account
hub / github.com/Aloshi/EmulationStation / input

Method input

src/components/GuiInputConfig.cpp:26–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26bool GuiInputConfig::input(InputConfig* config, Input input)
27{
28 if(config != mTargetConfig || input.value == 0)
29 return false;
30
31 if(mCurInputId >= inputCount)
32 {
33 //done
34 if(input.type == TYPE_BUTTON || input.type == TYPE_KEY)
35 {
36 if(mTargetConfig->getPlayerNum() < mWindow->getInputManager()->getNumPlayers() - 1)
37 {
38 mWindow->pushGui(new GuiInputConfig(mWindow, mWindow->getInputManager()->getInputConfigByPlayer(mTargetConfig->getPlayerNum() + 1)));
39 }else{
40 mWindow->getInputManager()->writeConfig();
41 mWindow->getInputManager()->startPolling(); //enable polling again since we're done
42 GuiGameList::create(mWindow);
43 }
44 delete this;
45 return true;
46 }
47 }else{
48 if(mCanSkip && config->isMappedTo("a", input))
49 {
50 mCurInputId++;
51 return true;
52 }
53
54 if(config->getMappedTo(input).size() > 0)
55 {
56 mErrorMsg = "Already mapped!";
57 return true;
58 }
59
60 input.configured = true;
61 LOG(LogInfo) << " [" << input.string() << "] -> " << inputName[mCurInputId];
62
63 config->mapInput(inputName[mCurInputId], input);
64 mCurInputId++;
65 mErrorMsg = "";
66
67 //for buttons with not enough buttons, press A to skip
68 if(mCurInputId >= 7)
69 {
70 mCanSkip = true;
71 }
72 return true;
73 }
74
75 return false;
76}
77
78void GuiInputConfig::render(const Eigen::Affine3f& parentTrans)
79{

Callers

nothing calls this directly

Calls 12

getPlayerNumMethod · 0.80
getNumPlayersMethod · 0.80
getInputManagerMethod · 0.80
pushGuiMethod · 0.80
writeConfigMethod · 0.80
startPollingMethod · 0.80
isMappedToMethod · 0.80
getMappedToMethod · 0.80
stringMethod · 0.80
mapInputMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected