| 69 | } |
| 70 | |
| 71 | bool 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 | |
| 92 | std::vector<std::string> InputConfig::getMappedTo(Input input) |
| 93 | { |