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