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

Method input

src/components/GuiDetectDevice.cpp:25–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25bool GuiDetectDevice::input(InputConfig* config, Input input)
26{
27 if((input.type == TYPE_BUTTON || input.type == TYPE_KEY))
28 {
29 if(config->getPlayerNum() != -1)
30 {
31 if(config->getPlayerNum() == 0)
32 {
33 if(input.value)
34 {
35 mFinishTimer = 0;
36 mHoldingFinish = true;
37 }else{
38 mHoldingFinish = false;
39 }
40 }
41 return true;
42 }
43
44 if(!input.value)
45 return false;
46
47 //don't allow device list to change once the first player has registered
48 if(mCurrentPlayer == 0)
49 mWindow->getInputManager()->stopPolling();
50
51 config->setPlayerNum(mCurrentPlayer);
52 mWindow->getInputManager()->setNumPlayers(mWindow->getInputManager()->getNumPlayers() + 1); //inc total number of players
53 mCurrentPlayer++;
54
55 //mapped everything we possibly can?
56 if(mCurrentPlayer >= mWindow->getInputManager()->getNumJoysticks() + 1) //+1 for keyboard
57 {
58 done();
59 }
60
61 return true;
62 }
63
64 return false;
65}
66
67void GuiDetectDevice::done()
68{

Callers

nothing calls this directly

Calls 7

getPlayerNumMethod · 0.80
stopPollingMethod · 0.80
getInputManagerMethod · 0.80
setPlayerNumMethod · 0.80
setNumPlayersMethod · 0.80
getNumPlayersMethod · 0.80
getNumJoysticksMethod · 0.80

Tested by

no test coverage detected