🔑 added mobile events in main 🚏
This commit is contained in:
parent
b2a8e3bf96
commit
2a790a51a9
|
@ -14,7 +14,7 @@ manager.save()
|
||||||
manager.update()
|
manager.update()
|
||||||
|
|
||||||
window.onerror = (message: string, url: string, lineNumber: number): boolean => {
|
window.onerror = (message: string, url: string, lineNumber: number): boolean => {
|
||||||
error(message,"",{
|
error(message, "", {
|
||||||
...manager.alertOptions,
|
...manager.alertOptions,
|
||||||
onclick: () => modal({
|
onclick: () => modal({
|
||||||
no: "",
|
no: "",
|
||||||
|
@ -51,18 +51,27 @@ const handleEvent = <T>(e: T, func: (e: T) => any) => {
|
||||||
manager.barAlpha.next("0")
|
manager.barAlpha.next("0")
|
||||||
}
|
}
|
||||||
|
|
||||||
render(html`
|
const moveHandler = (e: MouseEvent) => handleEvent(e, (e: MouseEvent) => {
|
||||||
<div @mousemove=${(e: MouseEvent) => handleEvent(e, (e: MouseEvent) => {
|
|
||||||
manager.handleMouseMove(e)
|
manager.handleMouseMove(e)
|
||||||
screen.updateMouse(e)
|
screen.updateMouse(e)
|
||||||
})}
|
})
|
||||||
|
|
||||||
|
render(html`
|
||||||
|
<div @mousemove=${moveHandler}
|
||||||
|
@touchmove=${moveHandler}
|
||||||
@mousedown=${(e: MouseEvent) => handleEvent(e, () =>
|
@mousedown=${(e: MouseEvent) => handleEvent(e, () =>
|
||||||
manager.handleMouseDown()
|
manager.handleMouseDown()
|
||||||
)}
|
)}
|
||||||
@mouseup=${(e: MouseEvent) => handleEvent(e, () =>
|
@touchdown=${(e: MouseEvent) => handleEvent(e, () =>
|
||||||
|
manager.handleMouseDown()
|
||||||
|
)}
|
||||||
|
@mouseup=${(e: MouseEvent) => handleEvent(e, () =>
|
||||||
manager.handleMouseUp()
|
manager.handleMouseUp()
|
||||||
)}
|
)}
|
||||||
@wheel=${(e: MouseEvent) => handleEvent(e, (e: WheelEvent) =>
|
@touchup=${(e: MouseEvent) => handleEvent(e, () =>
|
||||||
|
manager.handleMouseUp()
|
||||||
|
)}
|
||||||
|
@wheel=${(e: MouseEvent) => handleEvent(e, (e: WheelEvent) =>
|
||||||
screen.handleScroll(e)
|
screen.handleScroll(e)
|
||||||
)}>
|
)}>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue