mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-08 07:22:25 +02:00
Merge pull request #6274 from ZappoMan/rightClickMenu
add example of overriding default rightClick behavior
This commit is contained in:
commit
192e4c8185
2 changed files with 11 additions and 1 deletions
10
examples/controllers/rightClickExample.js
Normal file
10
examples/controllers/rightClickExample.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
var MAPPING_NAME = "com.highfidelity.rightClickExample";
|
||||
var mapping = Controller.newMapping(MAPPING_NAME);
|
||||
mapping.from(Controller.Hardware.Keyboard.RightMouseClicked).to(function (value) {
|
||||
print("Keyboard.RightMouseClicked");
|
||||
});
|
||||
Controller.enableMapping(MAPPING_NAME);
|
||||
|
||||
Script.scriptEnding.connect(function () {
|
||||
Controller.disableMapping(MAPPING_NAME);
|
||||
});
|
|
@ -677,7 +677,7 @@ Mapping::Pointer UserInputMapper::newMapping(const QString& mappingName) {
|
|||
|
||||
void UserInputMapper::enableMapping(const QString& mappingName, bool enable) {
|
||||
Locker locker(_lock);
|
||||
qCDebug(controllers) << "Attempting to enable mapping " << mappingName;
|
||||
qCDebug(controllers) << "Attempting to " << (enable ? "enable" : "disable") << " mapping " << mappingName;
|
||||
auto iterator = _mappingsByName.find(mappingName);
|
||||
if (_mappingsByName.end() == iterator) {
|
||||
qCWarning(controllers) << "Request to enable / disable unknown mapping " << mappingName;
|
||||
|
|
Loading…
Reference in a new issue