early-access version 2201

This commit is contained in:
pineappleEA
2021-11-15 02:13:48 +01:00
parent ecea1de808
commit e7e23d3a10
88 changed files with 4284 additions and 4864 deletions

View File

@@ -28,6 +28,10 @@ void MappingFactory::RegisterInput(const MappingData& data) {
if (!is_enabled) {
return;
}
if (!IsDriverValid(data)) {
return;
}
switch (input_type) {
case Polling::InputType::Button:
RegisterButton(data);
@@ -168,4 +172,25 @@ void MappingFactory::RegisterMotion(const MappingData& data) {
input_queue.Push(new_input);
}
bool MappingFactory::IsDriverValid(const MappingData& data) const {
// Only port 0 can be mapped on the keyboard
if (data.engine == "keyboard" && data.pad.port != 0) {
return false;
}
// The following drivers don't need to be mapped
if (data.engine == "tas") {
return false;
}
if (data.engine == "touch") {
return false;
}
if (data.engine == "touch_from_button") {
return false;
}
if (data.engine == "analog_from_button") {
return false;
}
return true;
}
} // namespace InputCommon