mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
xbox controller works on restart
This commit is contained in:
parent
dd97f16728
commit
5daccba235
3 changed files with 7 additions and 3 deletions
|
@ -77,7 +77,7 @@ void UserInputMapper::registerDevice(InputDevice::Pointer device) {
|
|||
}
|
||||
const auto& deviceID = device->_deviceID;
|
||||
|
||||
//recordDeviceOfType(device->getName());
|
||||
recordDeviceOfType(device->getName());
|
||||
|
||||
qCDebug(controllers) << "Registered input device <" << device->getName() << "> deviceID = " << deviceID;
|
||||
|
||||
|
@ -126,6 +126,10 @@ void UserInputMapper::removeDevice(int deviceID) {
|
|||
auto device = proxyEntry->second;
|
||||
qCDebug(controllers) << "Unregistering input device <" << device->getName() << "> deviceID = " << deviceID;
|
||||
|
||||
if (!_deviceCounts.contains(device->getName())) {
|
||||
_deviceCounts[device->getName()] -= 1;
|
||||
}
|
||||
|
||||
unloadMappings(device->getDefaultMappingConfigs());
|
||||
|
||||
auto mappingsEntry = _mappingsByDevice.find(deviceID);
|
||||
|
|
|
@ -142,7 +142,7 @@ namespace controller {
|
|||
std::vector<float> _lastStandardStates = std::vector<float>();
|
||||
|
||||
int recordDeviceOfType(const QString& deviceName);
|
||||
QHash<const QString&, int> _deviceCounts;
|
||||
QHash<const QString, int> _deviceCounts;
|
||||
|
||||
static float getValue(const EndpointPointer& endpoint, bool peek = false);
|
||||
static Pose getPose(const EndpointPointer& endpoint, bool peek = false);
|
||||
|
|
|
@ -64,7 +64,7 @@ void Joystick::handleButtonEvent(const SDL_ControllerButtonEvent& event) {
|
|||
|
||||
controller::Input::NamedVector Joystick::getAvailableInputs() const {
|
||||
using namespace controller;
|
||||
static const Input::NamedVector availableInputs{
|
||||
const Input::NamedVector availableInputs{
|
||||
makePair(A, "A"),
|
||||
makePair(B, "B"),
|
||||
makePair(X, "X"),
|
||||
|
|
Loading…
Reference in a new issue