From 41a8fe86c66f3d870f4220420c6c6085ad146bed Mon Sep 17 00:00:00 2001 From: BigTeri Date: Mon, 7 Nov 2016 20:37:56 +0100 Subject: [PATCH] fix mouse scroll, fix bin, fix dependency --- bin/index.js | 2 ++ dist/index.js | 5 +++-- dist/mouse.js | 2 +- package.json | 8 ++++---- server/mouse.js | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/bin/index.js b/bin/index.js index 80f46ef..b856257 100644 --- a/bin/index.js +++ b/bin/index.js @@ -1 +1,3 @@ +#!/usr/bin/env node + require("../dist"); diff --git a/dist/index.js b/dist/index.js index 60bf3e9..b221dd4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -32,10 +32,11 @@ app.use(_express2.default.static(_path2.default.join(__dirname, "../client"))); const screen = new _screen2.default(); const mouse = new _mouse2.default(screen); const keyboard = new _keyboard2.default(); +const port = 4444; const rootPath = ""; -const httpSocket = app.listen(4444, () => { - console.log("server started"); +const httpSocket = app.listen(port, () => { + console.log("server started on port ", port); }); const io = (0, _socket2.default)(httpSocket, { diff --git a/dist/mouse.js b/dist/mouse.js index f9c4193..ddbe472 100644 --- a/dist/mouse.js +++ b/dist/mouse.js @@ -51,7 +51,7 @@ class Mouse { _robotjs2.default.moveMouse(this.x, this.y); } - scroll() { + scroll(deltaY) { _robotjs2.default.scrollMouse(2, deltaY > 0 ? "down" : "up"); } } diff --git a/package.json b/package.json index b30ffde..d1795a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jsremote", - "version": "0.1.1", + "version": "0.1.2", "description": "NodeJS desktop remote using HTML5 Pointerlock", "main": "server/index.js", "scripts": { @@ -19,13 +19,13 @@ }, "dependencies": { "jspm": "^0.16.47", + "robotjs": "^0.4.5", "express": "^4.14.0", - "robotjs": "^0.4.5" + "socket.io": "^1.5.1" }, "devDependencies": { "babel-cli": "^6.18.0", - "babel-preset-es2015-node": "^6.1.1", - "socket.io": "^1.5.1" + "babel-preset-es2015-node": "^6.1.1" }, "jspm": { "directories": { diff --git a/server/mouse.js b/server/mouse.js index 43103f5..b47f0e1 100644 --- a/server/mouse.js +++ b/server/mouse.js @@ -41,7 +41,7 @@ export default class Mouse { robot.moveMouse(this.x, this.y); } - scroll() { + scroll(deltaY) { robot.scrollMouse(2, deltaY > 0 ? "down" : "up"); } }