mirror of
https://github.com/overte-org/overte.git
synced 2025-08-13 09:49:45 +02:00
map Controller.Standard.RB so xbox controller works. whee.
This commit is contained in:
parent
e2e7573e93
commit
515e6fd34e
1 changed files with 14 additions and 5 deletions
|
@ -354,11 +354,18 @@ Messages.subscribe(MESSAGE_CHANNEL);
|
|||
Messages.messageReceived.connect(messageHandler);
|
||||
|
||||
|
||||
function makeGripHandler(hand) {
|
||||
function makeGripHandler(hand, animate) {
|
||||
// determine if we are gripping or un-gripping
|
||||
return function (value) {
|
||||
updateTriggers(value, false, hand);
|
||||
};
|
||||
if (animate) {
|
||||
return function(value) {
|
||||
updateTriggers(value, true, hand);
|
||||
};
|
||||
|
||||
} else {
|
||||
return function (value) {
|
||||
updateTriggers(value, false, hand);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function keyPressEvent(event) {
|
||||
|
@ -377,10 +384,12 @@ friendsMapping.from(Controller.Standard.LeftGrip).peek().to(makeGripHandler(Cont
|
|||
friendsMapping.from(Controller.Standard.RightGrip).peek().to(makeGripHandler(Controller.Standard.RightHand));
|
||||
|
||||
// setup keyboard initiation
|
||||
|
||||
Controller.keyPressEvent.connect(keyPressEvent);
|
||||
Controller.keyReleaseEvent.connect(keyReleaseEvent);
|
||||
|
||||
// xbox controller cuz that's important
|
||||
friendsMapping.from(Controller.Standard.RB).peek().to(makeGripHandler(Controller.Standard.RightHand, true));
|
||||
|
||||
// it is easy to forget this and waste a lot of time for nothing
|
||||
friendsMapping.enable();
|
||||
|
||||
|
|
Loading…
Reference in a new issue