mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
Add mutex
This commit is contained in:
parent
5ccbc5c029
commit
2c6003e40b
2 changed files with 9 additions and 1 deletions
|
@ -178,6 +178,11 @@ namespace controller {
|
||||||
return inputRecorder->getSaveDirectory();
|
return inputRecorder->getSaveDirectory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QStringList ScriptingInterface::getRunningInputDeviceNames() {
|
||||||
|
QMutexLocker locker(&_mutex);
|
||||||
|
return _runningInputDeviceNames;
|
||||||
|
}
|
||||||
|
|
||||||
bool ScriptingInterface::triggerHapticPulseOnDevice(unsigned int device, float strength, float duration, controller::Hand hand) const {
|
bool ScriptingInterface::triggerHapticPulseOnDevice(unsigned int device, float strength, float duration, controller::Hand hand) const {
|
||||||
return DependencyManager::get<UserInputMapper>()->triggerHapticPulseOnDevice(device, strength, duration, hand);
|
return DependencyManager::get<UserInputMapper>()->triggerHapticPulseOnDevice(device, strength, duration, hand);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
#include <QtCore/QVariant>
|
#include <QtCore/QVariant>
|
||||||
|
#include <QMutex>
|
||||||
|
|
||||||
#include <QtQml/QJSValue>
|
#include <QtQml/QJSValue>
|
||||||
#include <QtScript/QScriptValue>
|
#include <QtScript/QScriptValue>
|
||||||
|
@ -436,7 +437,7 @@ namespace controller {
|
||||||
* @function Controller.getRunningInputDevices
|
* @function Controller.getRunningInputDevices
|
||||||
* @returns {string[]} An array of strings with the names
|
* @returns {string[]} An array of strings with the names
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE QStringList getRunningInputDeviceNames() { return _runningInputDeviceNames; }
|
Q_INVOKABLE QStringList getRunningInputDeviceNames();
|
||||||
|
|
||||||
bool isMouseCaptured() const { return _mouseCaptured; }
|
bool isMouseCaptured() const { return _mouseCaptured; }
|
||||||
bool isTouchCaptured() const { return _touchCaptured; }
|
bool isTouchCaptured() const { return _touchCaptured; }
|
||||||
|
@ -627,6 +628,8 @@ namespace controller {
|
||||||
std::atomic<bool> _touchCaptured { false };
|
std::atomic<bool> _touchCaptured { false };
|
||||||
std::atomic<bool> _wheelCaptured { false };
|
std::atomic<bool> _wheelCaptured { false };
|
||||||
std::atomic<bool> _actionsCaptured { false };
|
std::atomic<bool> _actionsCaptured { false };
|
||||||
|
|
||||||
|
QMutex _mutex;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue