mirror of
https://github.com/FlamedDogo99/EaglerMobile.git
synced 2024-11-21 03:26:04 -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/
|
||||
// @match https://eaglercraft.com/mc/*
|
||||
// @grant none
|
||||
// @version 1.1
|
||||
// @version 1.2
|
||||
// @updateURL https://raw.githubusercontent.com/FlamedDogo99/EaglerMobile/main/eaglermobile.js
|
||||
// @run-at document-start
|
||||
// ==/UserScript==
|
||||
|
@ -210,10 +210,7 @@ function insertCanvasElements() {
|
|||
}
|
||||
e.movementX = touch.pageX - previousX;
|
||||
e.movementY = touch.pageY - previousY;
|
||||
var evt = new MouseEvent("mousemove", {
|
||||
movementX: e.movementX,
|
||||
movementY: e.movementY
|
||||
});
|
||||
var evt = window.fakelock ? new MouseEvent("mousemove", {movementX: e.movementX, movementY: e.movementY}) : new WheelEvent("wheel", {"wheelDeltaY": e.movementY});
|
||||
canvas.dispatchEvent(evt);
|
||||
previousX = touch.pageX;
|
||||
previousY = touch.pageY;
|
||||
|
|
Loading…
Reference in New Issue
Block a user