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. 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

View File

@ -4,6 +4,7 @@ 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 isRightClicking = false;
let isClicking = true; let isClicking = true;
let step = 1; let step = 1;
let stepBump = 0.1; let stepBump = 0.1;
@ -21,6 +22,8 @@ $(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 {
@ -67,6 +70,11 @@ $(function () {
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 ;
} }