mirror of
https://github.com/FlamedDogo99/EaglerMobile.git
synced 2024-11-21 11:36:05 -08:00
Added touch scrolling in menus
The fake mouse event script now dispatches a scroll event if the pointerlock element is null
This commit is contained in:
parent
19e7b49650
commit
657aa3a1ab
|
@ -7,7 +7,7 @@
|
||||||
// @license Apache License 2.0 - http://www.apache.org/licenses/
|
// @license Apache License 2.0 - http://www.apache.org/licenses/
|
||||||
// @match https://eaglercraft.com/mc/*
|
// @match https://eaglercraft.com/mc/*
|
||||||
// @grant none
|
// @grant none
|
||||||
// @version 1.1
|
// @version 1.2
|
||||||
// @updateURL https://raw.githubusercontent.com/FlamedDogo99/EaglerMobile/main/eaglermobile.js
|
// @updateURL https://raw.githubusercontent.com/FlamedDogo99/EaglerMobile/main/eaglermobile.js
|
||||||
// @run-at document-start
|
// @run-at document-start
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
|
@ -210,10 +210,7 @@ function insertCanvasElements() {
|
||||||
}
|
}
|
||||||
e.movementX = touch.pageX - previousX;
|
e.movementX = touch.pageX - previousX;
|
||||||
e.movementY = touch.pageY - previousY;
|
e.movementY = touch.pageY - previousY;
|
||||||
var evt = new MouseEvent("mousemove", {
|
var evt = window.fakelock ? new MouseEvent("mousemove", {movementX: e.movementX, movementY: e.movementY}) : new WheelEvent("wheel", {"wheelDeltaY": e.movementY});
|
||||||
movementX: e.movementX,
|
|
||||||
movementY: e.movementY
|
|
||||||
});
|
|
||||||
canvas.dispatchEvent(evt);
|
canvas.dispatchEvent(evt);
|
||||||
previousX = touch.pageX;
|
previousX = touch.pageX;
|
||||||
previousY = touch.pageY;
|
previousY = touch.pageY;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user