Skip to content

Commit

Permalink
Added mouse buttons 4 and 5 to InputManager mouse handling (#12765)
Browse files Browse the repository at this point in the history
  • Loading branch information
PolygonalSun authored Jul 19, 2022
1 parent 7899cf7 commit 612b191
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/dev/core/src/Inputs/scene.inputManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,13 @@ export class InputManager {
this._deviceSourceManager.onDeviceConnectedObservable.add((deviceSource) => {
if (deviceSource.deviceType === DeviceType.Mouse) {
deviceSource.onInputChangedObservable.add((eventData) => {
if (eventData.inputIndex === PointerInput.LeftClick || eventData.inputIndex === PointerInput.MiddleClick || eventData.inputIndex === PointerInput.RightClick) {
if (
eventData.inputIndex === PointerInput.LeftClick ||
eventData.inputIndex === PointerInput.MiddleClick ||
eventData.inputIndex === PointerInput.RightClick ||
eventData.inputIndex === PointerInput.BrowserBack ||
eventData.inputIndex === PointerInput.BrowserForward
) {
if (attachDown && deviceSource.getInput(eventData.inputIndex) === 1) {
this._onPointerDown(eventData);
} else if (attachUp && deviceSource.getInput(eventData.inputIndex) === 0) {
Expand Down

0 comments on commit 612b191

Please sign in to comment.