Skip to content

Commit

Permalink
Correct issues with mouse/pointer tap input handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jelster committed Jul 19, 2021
1 parent 73fdbae commit 75130e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/inputActionMaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const inputControlsMap = {
/* */

/* Mouse and Touch Mappings */
//PointerTap: 'ACTIVATE',
PointerTap: 'ACTIVATE',
/* */

/* Gamepad Mappings */
Expand Down
10 changes: 5 additions & 5 deletions src/spaceTruckerInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ class SpaceTruckerInputManager {

enableMouse(scene) {
const obs = scene.onPointerObservable.add((pointerInfo) => {
if (pointerInfo.type === PointerEventTypes.POINTERTAP) {
this.inputMap["PointerTap"] = pointerInfo.event;

if (pointerInfo.type === PointerEventTypes.POINTERDOWN) {
this.inputMap["PointerTap"] = pointerInfo;
}
else if (pointerInfo.type === PointerEventTypes.POINTERUP) {
if (this.inputMap["PointerTap"] != null) {
delete this.inputMap["PointerTap"];
}
delete this.inputMap["PointerTap"];
}

});

const checkInputs = () => { };
Expand Down

0 comments on commit 75130e9

Please sign in to comment.