mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-02 06:40:42 -07:00
rawinput: add basic support for xinput (#617)
## Link to GitHub Issue or related Pull Request, if one exists #616 ## Description of change Adds preliminary support for XInput controllers. Enough to manually bind buttons and map analogs.
This commit is contained in:
@@ -2165,6 +2165,9 @@ namespace overlay::windows {
|
||||
case rawinput::MIDI:
|
||||
this->analogs_devices.emplace_back(&device);
|
||||
break;
|
||||
case rawinput::XINPUT_GAMEPAD:
|
||||
this->analogs_devices.emplace_back(&device);
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
@@ -2289,6 +2292,15 @@ namespace overlay::windows {
|
||||
onoff.size());
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case rawinput::XINPUT_GAMEPAD: {
|
||||
for (int i = 0; i < static_cast<int>(xinput::XInputAnalogEnum::COUNT); i++) {
|
||||
const auto v = static_cast<xinput::XInputAnalogEnum>(i);
|
||||
control_names.push_back(xinput::get_analog_string(v));
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -732,6 +732,10 @@ namespace overlay::windows {
|
||||
ImGui::Text("Type: PIUIO");
|
||||
break;
|
||||
}
|
||||
case rawinput::XINPUT_GAMEPAD: {
|
||||
ImGui::Text("Type: XInput");
|
||||
break;
|
||||
}
|
||||
case rawinput::DESTROYED: {
|
||||
ImGui::Text("Disconnected.");
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user