fixed scroll, fixed rclick

This commit is contained in:
Maxim Stewart 2020-07-09 20:39:01 -05:00
parent f7e0ec9ff6
commit 8edb1d71e7
2 changed files with 28 additions and 17 deletions

View File

@ -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.
# Fixes
* Fixed scroll direction detection.
* Fixed right click detection on release.
# Notes
* Need python 2+
* 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/ ```
Linux/Mac
``` source venv/bin/activate ```
``` source bin/activate ```
Windows
``` source venv/bin/Scripts/activate ```
``` source bin/Scripts/activate ```
Linux/Mac
``` pip install -r linux-requirements.txt ```
@ -37,4 +41,3 @@ Windows
![1 Interface.... ](images/pic1.png)
# TODO
* n/a

View File

@ -1,15 +1,16 @@
const socket = io();
let mouseHoldToggle = document.getElementById("mouseHoldToggle");
let scrollTggl = document.getElementById("scrollToggle");
let clickSound = document.getElementById("clickSound");
let isHoldingMouse = false;
let isScrolling = false;
let isClicking = true;
let step = 1;
let stepBump = 0.1;
let mod = 0;
let px = 0;
let py = 0;
let scrollTggl = document.getElementById("scrollToggle");
let clickSound = document.getElementById("clickSound");
let isHoldingMouse = false;
let isScrolling = false;
let isRightClicking = false;
let isClicking = true;
let step = 1;
let stepBump = 0.1;
let mod = 0;
let px = 0;
let py = 0;
socket.on('connect', function() {
@ -20,7 +21,9 @@ socket.on('connect', function() {
$(function () {
$.mousedirection();
$("#canvas").on("mousedirection", function (e) {
isClicking = false;
isClicking = false;
isRightClicking = false;
if (e.direction == "up") {
px = 0;
py = -step - mod;
@ -52,7 +55,7 @@ $(function () {
if (isScrolling) {
if (e.direction == "up") {
socket.emit('scroll_up', "");
} else {
} else if (e.direction == "down") {
socket.emit('scroll_down', "");
}
} else {
@ -66,7 +69,12 @@ $(function () {
// Touch events converted to mouse events
function touchHandler(event) {
if (event.type == "touchstart" && event.touches.length > 1) {
isClicking = false;
isClicking = false;
isRightClicking = true;
}
if (event.type == "touchend" && isRightClicking) {
isRightClicking = false;
rightClick();
return ;
}