How to use the robotjs.scrollMouse function in robotjs

To help you get started, we’ve selected a few robotjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zz85 / contact.js / src / touchpad.js View on Github external
onInterval() {
		if (this._isScrolling()) {
			console.log('scrolling', this.scrollYspeed);
			robot.scrollMouse(0, -this.scrollYspeed | 0);
			this.scrollYspeed *= 0.85;
		} else {
			this.scrollYspeed = 0;
		}
			
		this.updateMouse();
		this.sendPack('mc', [this.mouse.x / this.screenSize.width, this.mouse.y / this.screenSize.height])
	}
github jitsi / jitsi-meet-electron / modules / remotecontrol / index.js View on Github external
mouseButtonStatus = MOUSE_ACTIONS_FROM_EVENT_TYPE[event.type];
                robot.mouseToggle(
                    mouseButtonStatus,
                    (event.button ? MOUSE_BUTTONS[event.button] : undefined));
                break;
            }
            case EVENT_TYPES.mousedblclick: {
                robot.mouseClick(
                    (event.button ? MOUSE_BUTTONS[event.button] : undefined),
                    true);
                break;
            }
            case EVENT_TYPES.mousescroll:{
                //FIXME: implement horizontal scrolling
                if(event.y !== 0) {
                    robot.scrollMouse(
                        Math.abs(event.y),
                        event.y > 0 ? "down" : "up"
                    );
                }
                break;
            }
            case EVENT_TYPES.keydown:
            case EVENT_TYPES.keyup: {
                robot.keyToggle(event.key,
                    KEY_ACTIONS_FROM_EVENT_TYPE[event.type], event.modifiers);
                break;
            }
            case EVENT_TYPES.permissions: {
                if(event.action !== PERMISSIONS_ACTIONS.request)
                    break;
github Macmee / OpenMouse / client.js View on Github external
client.on('wh', data => {
  robot.scrollMouse(data.x || 0, data.y || 0);
});
github Jay-Rad / DoXM / DoXM_Remote_Control / Services / RCDeviceSockets.ts View on Github external
this.HubConnection.on("MouseWheel", (deltaX: number, deltaY: number, requesterID: string) => {
            if (RCClient.Mode == "Normal" && ViewOnlyToggle.checked) {
                return;
            }
            var viewer = RCClient.ViewerList.find(x => x.ViewerConnectionID == requesterID);
            if (viewer) {
                var modifiedX = (deltaX > 0 ? 120 : -120) * -1;
                var modifiedY = (deltaY > 0 ? 120 : -120) * -1;
                Robot.scrollMouse(modifiedX, modifiedY);
            }
        });
        this.HubConnection.on("KeyDown", (key: string, requesterID: string) => {
github jitsi / jitsi-meet-electron-utils / remotecontrol / index.js View on Github external
this._mouseButtonStatus,
                    (data.button
                            ? MOUSE_BUTTONS[data.button] : undefined));
                break;
            }
            case EVENTS.mousedblclick: {
                robot.mouseClick(
                    (data.button
                        ? MOUSE_BUTTONS[data.button] : undefined),
                    true);
                break;
            }
            case EVENTS.mousescroll:{
                const { x, y } = data;
                if(x !== 0 || y !== 0) {
                    robot.scrollMouse(x, y);
                }
                break;
            }
            case EVENTS.keydown:
            case EVENTS.keyup: {
                robot.keyToggle(
                    data.key,
                    KEY_ACTIONS_FROM_EVENT_TYPE[data.type],
                    data.modifiers);
                break;
            }
            case REQUESTS.start: {
                this._start(id, data.sourceId);
                break;
            }
            case EVENTS.stop: {
github lucent-sea / InstaTech_Client / InstaTech_CP / app / index.js View on Github external
else if (jsonMessage.Ctrl) {
                    robot.keyToggle("control", "up");
                }
                else if (jsonMessage.Shift) {
                    robot.keyToggle("shift", "up");
                }
                break;
            case "MouseWheel":
                var dir;
                if (jsonMessage.DeltaY < 0) {
                    dir = "up";
                }
                else if (jsonMessage.DeltaY > 0) {
                    dir = "down";
                }
                robot.scrollMouse(1, dir);
            case "TouchMove":
                var mousePos = robot.getMousePos();
                robot.moveMouse(Math.round(jsonMessage.MoveByX * totalWidth + mousePos.x), Math.round(jsonMessage.MoveByY * totalWidth + mousePos.y));
                break;
            case "Tap":
                robot.mouseClick();
                break;
            case "TouchDown":
                robot.mouseToggle("down", "left");
                break;
            case "LongPress":
                robot.mouseClick("right");
                break;
            case "TouchUp":
                robot.mouseToggle("up", "left");
                break;
github Jay-Rad / DoXM / DoXM_Remote_Control / Services / RCDeviceSockets.js View on Github external
this.HubConnection.on("MouseWheel", (deltaX, deltaY, requesterID) => {
            if (RCClient_1.RCClient.Mode == "Normal" && NormalPage_1.ViewOnlyToggle.checked) {
                return;
            }
            var viewer = RCClient_1.RCClient.ViewerList.find(x => x.ViewerConnectionID == requesterID);
            if (viewer) {
                var modifiedX = (deltaX > 0 ? 120 : -120) * -1;
                var modifiedY = (deltaY > 0 ? 120 : -120) * -1;
                Robot.scrollMouse(modifiedX, modifiedY);
            }
        });
        this.HubConnection.on("KeyDown", (key, requesterID) => {