create wheel event remote
This commit is contained in:
@@ -83,25 +83,15 @@ async function mouseUp(button: "left" | "right" | "middle" | undefined): Promise
|
|||||||
}
|
}
|
||||||
async function wheelUp(): Promise<void> {
|
async function wheelUp(): Promise<void> {
|
||||||
const self = (page.mouse as any);
|
const self = (page.mouse as any);
|
||||||
return await self._client.send('Input.dispatchMouseEvent', {
|
return await page.evaluate(`
|
||||||
type: 'mouseWheel',
|
window.term.element.dispatchEvent(new WheelEvent('wheel', {clientX: ${self._x}, clientY: ${self._y}, deltaX: 0, deltaY: -10, modifiers: ${self._keyboard._modifiers}}));
|
||||||
x: self._x,
|
`);
|
||||||
y: self._y,
|
|
||||||
deltaX: 0,
|
|
||||||
deltaY: -10,
|
|
||||||
modifiers: self._keyboard._modifiers
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
async function wheelDown(): Promise<void> {
|
async function wheelDown(): Promise<void> {
|
||||||
const self = (page.mouse as any);
|
const self = (page.mouse as any);
|
||||||
return await self._client.send('Input.dispatchMouseEvent', {
|
return await page.evaluate(`
|
||||||
type: 'mouseWheel',
|
window.term.element.dispatchEvent(new WheelEvent('wheel', {clientX: ${self._x}, clientY: ${self._y}, deltaX: 0, deltaY: 10, modifiers: ${self._keyboard._modifiers}}));
|
||||||
x: self._x,
|
`);
|
||||||
y: self._y,
|
|
||||||
deltaX: 0,
|
|
||||||
deltaY: 10,
|
|
||||||
modifiers: self._keyboard._modifiers
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// extract button data from buttonCode
|
// extract button data from buttonCode
|
||||||
|
|||||||
Reference in New Issue
Block a user