mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-07 08:07:18 +02:00
Update better-xcloud.user.js
This commit is contained in:
parent
2ed1e8735f
commit
559c3c52c3
32
dist/better-xcloud.user.js
vendored
32
dist/better-xcloud.user.js
vendored
@ -3065,6 +3065,8 @@ class NativeMkbHandler extends MkbHandler {
|
|||||||
#pointerClient;
|
#pointerClient;
|
||||||
#enabled = false;
|
#enabled = false;
|
||||||
#mouseButtonsPressed = 0;
|
#mouseButtonsPressed = 0;
|
||||||
|
#mouseWheelX = 0;
|
||||||
|
#mouseWheelY = 0;
|
||||||
#inputSink;
|
#inputSink;
|
||||||
#$message;
|
#$message;
|
||||||
static getInstance() {
|
static getInstance() {
|
||||||
@ -3216,9 +3218,8 @@ class NativeMkbHandler extends MkbHandler {
|
|||||||
X: data.movementX,
|
X: data.movementX,
|
||||||
Y: data.movementY,
|
Y: data.movementY,
|
||||||
Buttons: this.#mouseButtonsPressed,
|
Buttons: this.#mouseButtonsPressed,
|
||||||
WheelX: 0,
|
WheelX: this.#mouseWheelX,
|
||||||
WheelY: 0,
|
WheelY: this.#mouseWheelY
|
||||||
Type: 0
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
handleMouseClick(data) {
|
handleMouseClick(data) {
|
||||||
@ -3228,17 +3229,27 @@ class NativeMkbHandler extends MkbHandler {
|
|||||||
} else {
|
} else {
|
||||||
this.#mouseButtonsPressed ^= pointerButton;
|
this.#mouseButtonsPressed ^= pointerButton;
|
||||||
}
|
}
|
||||||
|
this.#mouseButtonsPressed = Math.max(0, this.#mouseButtonsPressed);
|
||||||
this.#sendMouseInput({
|
this.#sendMouseInput({
|
||||||
X: 0,
|
X: 0,
|
||||||
Y: 0,
|
Y: 0,
|
||||||
Buttons: this.#mouseButtonsPressed,
|
Buttons: this.#mouseButtonsPressed,
|
||||||
WheelX: 0,
|
WheelX: this.#mouseWheelX,
|
||||||
WheelY: 0,
|
WheelY: this.#mouseWheelY
|
||||||
Type: 0
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
handleMouseWheel(data) {
|
handleMouseWheel(data) {
|
||||||
return false;
|
const { vertical, horizontal } = data;
|
||||||
|
this.#mouseWheelX = horizontal * 50;
|
||||||
|
this.#mouseWheelY = vertical * 50;
|
||||||
|
this.#sendMouseInput({
|
||||||
|
X: 0,
|
||||||
|
Y: 0,
|
||||||
|
Buttons: this.#mouseButtonsPressed,
|
||||||
|
WheelX: this.#mouseWheelX,
|
||||||
|
WheelY: this.#mouseWheelY
|
||||||
|
});
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
waitForMouseData(enabled) {
|
waitForMouseData(enabled) {
|
||||||
}
|
}
|
||||||
@ -3246,18 +3257,19 @@ class NativeMkbHandler extends MkbHandler {
|
|||||||
return this.#enabled;
|
return this.#enabled;
|
||||||
}
|
}
|
||||||
#sendMouseInput(data) {
|
#sendMouseInput(data) {
|
||||||
data.Buttons = Math.max(0, data.Buttons);
|
data.Type = 0;
|
||||||
this.#inputSink?.onMouseInput(data);
|
this.#inputSink?.onMouseInput(data);
|
||||||
}
|
}
|
||||||
#resetMouseInput() {
|
#resetMouseInput() {
|
||||||
this.#mouseButtonsPressed = 0;
|
this.#mouseButtonsPressed = 0;
|
||||||
|
this.#mouseWheelX = 0;
|
||||||
|
this.#mouseWheelY = 0;
|
||||||
this.#sendMouseInput({
|
this.#sendMouseInput({
|
||||||
X: 0,
|
X: 0,
|
||||||
Y: 0,
|
Y: 0,
|
||||||
Buttons: 0,
|
Buttons: 0,
|
||||||
WheelX: 0,
|
WheelX: 0,
|
||||||
WheelY: 0,
|
WheelY: 0
|
||||||
Type: 0
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user