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

Method isMappedTo

src/InputConfig.cpp:71–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71bool InputConfig::isMappedTo(const std::string& name, Input input)
72{
73 Input comp = getInputByName(name);
74
75 if(comp.configured && comp.type == input.type && comp.id == input.id)
76 {
77 if(comp.type == TYPE_HAT)
78 {
79 return (input.value == 0 || input.value & comp.value);
80 }
81
82 if(comp.type == TYPE_AXIS)
83 {
84 return input.value == 0 || comp.value == input.value;
85 }else{
86 return true;
87 }
88 }
89 return false;
90}
91
92std::vector<std::string> InputConfig::getMappedTo(Input input)
93{

Callers 10

inputMethod · 0.80
inputMethod · 0.80
inputMethod · 0.80
inputMethod · 0.80
inputMethod · 0.80
inputMethod · 0.80
inputMethod · 0.80
inputMethod · 0.80
inputMethod · 0.80
inputMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected