Comparing version 0.1.0 to 0.1.1
@@ -248,8 +248,16 @@ import { mapValues } from 'lodash-es'; | ||
const gamepadVector = currentMovementVector.gamepads[gamepad.index]; | ||
if (gamepadVector.x === newMovement.x && gamepadVector.y === newMovement.y) | ||
if (gamepadVector.x === newMovement.x && gamepadVector.y === newMovement.z) | ||
continue; | ||
gamepadVector.x = newMovement.x; | ||
gamepadVector.y = newMovement.y; | ||
gamepadVector.z = newMovement.z; | ||
updateMovementVector({ gamepadIndex: gamepad.index }); | ||
} | ||
// todo emit all? | ||
const gamepad = gamepads[0]; | ||
if (gamepad) { | ||
for (const side of ['left', 'right']) { | ||
const rightStick = GamepadsStore.queryStick(side, GamepadsStore.getConnectedGamepads().find(({ index }) => index === gamepad.index)); | ||
this.emit('stickMovement', { stick: side, vector: rightStick }); | ||
} | ||
} | ||
prevPressedButtons = newPressedButtons; | ||
@@ -256,0 +264,0 @@ }, gamepadPollingInterval); |
@@ -22,3 +22,3 @@ import Emittery from 'emittery'; | ||
x: number; | ||
y: number; | ||
z: number; | ||
}; | ||
@@ -25,0 +25,0 @@ connectedGamepads: Gamepad[]; |
@@ -34,3 +34,3 @@ import Emittery from 'emittery'; | ||
x: gamepad.axes[resolvedStick.xAxis], | ||
y: gamepad.axes[resolvedStick.yAxis], | ||
z: gamepad.axes[resolvedStick.yAxis], | ||
}; | ||
@@ -37,0 +37,0 @@ } |
@@ -84,2 +84,6 @@ import { LiteralUnion } from 'type-fest'; | ||
releaseGrouped: GroupCommandEventArgument<K>; | ||
stickMovement: { | ||
stick: 'left' | 'right'; | ||
vector: MovementVector2d; | ||
}; | ||
movementUpdate: { | ||
@@ -86,0 +90,0 @@ vector: M extends '3d' ? MovementVector3d : MovementVector2d; |
{ | ||
"name": "contro-max", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Game controls done even better!", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
52952
1040
1