fixed scroll, fixed rclick
This commit is contained in:
parent
f7e0ec9ff6
commit
8edb1d71e7
11
README.md
11
README.md
|
@ -1,6 +1,10 @@
|
||||||
# Remote-Mouse
|
# Dropper
|
||||||
Remote Mouse is a flask + pyautogui app to control a PC from your phone or any other device.
|
Remote Mouse is a flask + pyautogui app to control a PC from your phone or any other device.
|
||||||
|
|
||||||
|
# Fixes
|
||||||
|
* Fixed scroll direction detection.
|
||||||
|
* Fixed right click detection on release.
|
||||||
|
|
||||||
# Notes
|
# Notes
|
||||||
* Need python 2+
|
* Need python 2+
|
||||||
* Make sure to change the port in the start script as needed. Have fun!
|
* Make sure to change the port in the start script as needed. Have fun!
|
||||||
|
@ -12,10 +16,10 @@ Remote Mouse is a flask + pyautogui app to control a PC from your phone or any o
|
||||||
``` python3 -m venv venv/ ```
|
``` python3 -m venv venv/ ```
|
||||||
|
|
||||||
Linux/Mac
|
Linux/Mac
|
||||||
``` source venv/bin/activate ```
|
``` source bin/activate ```
|
||||||
|
|
||||||
Windows
|
Windows
|
||||||
``` source venv/bin/Scripts/activate ```
|
``` source bin/Scripts/activate ```
|
||||||
|
|
||||||
Linux/Mac
|
Linux/Mac
|
||||||
``` pip install -r linux-requirements.txt ```
|
``` pip install -r linux-requirements.txt ```
|
||||||
|
@ -37,4 +41,3 @@ Windows
|
||||||
![1 Interface.... ](images/pic1.png)
|
![1 Interface.... ](images/pic1.png)
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
* n/a
|
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
const socket = io();
|
const socket = io();
|
||||||
let mouseHoldToggle = document.getElementById("mouseHoldToggle");
|
let mouseHoldToggle = document.getElementById("mouseHoldToggle");
|
||||||
let scrollTggl = document.getElementById("scrollToggle");
|
let scrollTggl = document.getElementById("scrollToggle");
|
||||||
let clickSound = document.getElementById("clickSound");
|
let clickSound = document.getElementById("clickSound");
|
||||||
let isHoldingMouse = false;
|
let isHoldingMouse = false;
|
||||||
let isScrolling = false;
|
let isScrolling = false;
|
||||||
let isClicking = true;
|
let isRightClicking = false;
|
||||||
let step = 1;
|
let isClicking = true;
|
||||||
let stepBump = 0.1;
|
let step = 1;
|
||||||
let mod = 0;
|
let stepBump = 0.1;
|
||||||
let px = 0;
|
let mod = 0;
|
||||||
let py = 0;
|
let px = 0;
|
||||||
|
let py = 0;
|
||||||
|
|
||||||
|
|
||||||
socket.on('connect', function() {
|
socket.on('connect', function() {
|
||||||
|
@ -20,7 +21,9 @@ socket.on('connect', function() {
|
||||||
$(function () {
|
$(function () {
|
||||||
$.mousedirection();
|
$.mousedirection();
|
||||||
$("#canvas").on("mousedirection", function (e) {
|
$("#canvas").on("mousedirection", function (e) {
|
||||||
isClicking = false;
|
isClicking = false;
|
||||||
|
isRightClicking = false;
|
||||||
|
|
||||||
if (e.direction == "up") {
|
if (e.direction == "up") {
|
||||||
px = 0;
|
px = 0;
|
||||||
py = -step - mod;
|
py = -step - mod;
|
||||||
|
@ -52,7 +55,7 @@ $(function () {
|
||||||
if (isScrolling) {
|
if (isScrolling) {
|
||||||
if (e.direction == "up") {
|
if (e.direction == "up") {
|
||||||
socket.emit('scroll_up', "");
|
socket.emit('scroll_up', "");
|
||||||
} else {
|
} else if (e.direction == "down") {
|
||||||
socket.emit('scroll_down', "");
|
socket.emit('scroll_down', "");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -66,7 +69,12 @@ $(function () {
|
||||||
// Touch events converted to mouse events
|
// Touch events converted to mouse events
|
||||||
function touchHandler(event) {
|
function touchHandler(event) {
|
||||||
if (event.type == "touchstart" && event.touches.length > 1) {
|
if (event.type == "touchstart" && event.touches.length > 1) {
|
||||||
isClicking = false;
|
isClicking = false;
|
||||||
|
isRightClicking = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.type == "touchend" && isRightClicking) {
|
||||||
|
isRightClicking = false;
|
||||||
rightClick();
|
rightClick();
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue