Replies: 1 comment 1 reply
-
@KostarSf Good question! Let me look into the details here. It looks like you might need to dig into the native event to get at the multiple buttons, https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons Looks like they're stashed in a bitmask engine.input.pointers.on("down", (evt) => {
const leftButtonPressed = 0b0001 & evt.nativeEvent.buttons;
const rightButtonPressed = 0b0010 & evt.nativeEvent.buttons;
const middleButtonPressed = 0b0100 & evt.nativeEvent.buttons;
...
}); Let me know if that helps! I think I'll look at expanding excalibur to have a friendlier way of exposing simultaneous presses |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi! I'm having some trouble developing a game. I can't track multiple mouse buttons pressed at the same time. Here is a sample code:
This works fine as long as the player doesn't hold down the left and right mouse buttons at the same time. In this case only the mouse button pressed first is triggered.
I tried making two separate events, but that didn't work either. Please advise how this can be implemented 🤔
Beta Was this translation helpful? Give feedback.
All reactions