added button, disabled zoom

This commit is contained in:
Maxim Stewart 2020-07-28 14:10:17 -05:00
parent 6575a9f61d
commit f30da94f6c
6 changed files with 48 additions and 4 deletions

View File

@ -2,8 +2,8 @@
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 # Fixes
* Fixed scroll direction detection. * Added delete button.
* Fixed right click detection on release. * Disabled touch zoom-in.
# Notes # Notes
* Need python 2+ * Need python 2+

View File

@ -1,4 +1,5 @@
# Python imports # Python imports
import subprocess
# Lib imports # Lib imports
import pyautogui import pyautogui
@ -30,6 +31,26 @@ def home():
message='Must use GET request type...') message='Must use GET request type...')
@app.route('/sound-manager')
def soundManager():
if request.method == 'GET':
# command = 'runuser -l abaddon bash -c "pacmd list-sink-inputs"'
command = 'sudo -u abaddon bash -c "pacmd list-sink-inputs"'
# command = 'sudo -u abaddon bash <<EOF pacmd list-sink-inputs EOF'
process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
result = process.wait()
print(process.stdout.read())
_apps = []
return render_template('sound-manager.html',
title=TITLE,
apps=_apps)
return render_template('error.html',
title='Error!',
message='Must use GET request type...')
@app.route('/update-coords/xy/<x>/<y>') @app.route('/update-coords/xy/<x>/<y>')
def updateCoords2(x, y): def updateCoords2(x, y):
try: try:

View File

@ -63,6 +63,12 @@ def pressEnter(eve = None):
pyautogui.press("enter") pyautogui.press("enter")
return "" return ""
@app.route('/press-back')
@socketio.on('press_back')
def pressBack(eve = None):
pyautogui.press("backspace")
return ""
@socketio.on('update_coords') @socketio.on('update_coords')
def updateCoords(message): def updateCoords(message):

View File

@ -142,6 +142,11 @@ function pressEnter() {
socket.emit('press_enter', ""); socket.emit('press_enter', "");
} }
function pressBack() {
socket.emit('press_back', "");
}
function scrollToggle() { function scrollToggle() {
if (isScrolling) { if (isScrolling) {
isScrolling = false; isScrolling = false;
@ -190,12 +195,12 @@ $( "#typingModalBtn" ).bind( "mouseup", async function(eve) {
$( "#closeControlsModalBtn" ).bind( "mouseup", async function(eve) { $( "#closeControlsModalBtn" ).bind( "mouseup", async function(eve) {
console.log("here"); console.log("here");
$('#controlsModal').modal({"focus": false, "show": false}); $('#controlsModal').modal('hide');
}); });
$( "#closeTypingModalBtn" ).bind( "mouseup", async function(eve) { $( "#closeTypingModalBtn" ).bind( "mouseup", async function(eve) {
console.log("here2"); console.log("here2");
$('#typingModal').modal({"focus": false, "show": false}); $('#typingModal').modal('hide');
}); });
@ -209,6 +214,8 @@ document.addEventListener("touchcancel", touchHandler, true);
document.getElementById("rightClickBtn").addEventListener("mouseup", rightClick, true); document.getElementById("rightClickBtn").addEventListener("mouseup", rightClick, true);
document.getElementById("sendKeysBtn").addEventListener("mouseup", sendKeys, true); document.getElementById("sendKeysBtn").addEventListener("mouseup", sendKeys, true);
document.getElementById("pressEnterBtn").addEventListener("mouseup", pressEnter, true); document.getElementById("pressEnterBtn").addEventListener("mouseup", pressEnter, true);
document.getElementById("pressBackBtn").addEventListener("mouseup", pressBack, true);
document.getElementById("scrollToggle").addEventListener("mouseup", scrollToggle, true); document.getElementById("scrollToggle").addEventListener("mouseup", scrollToggle, true);
document.getElementById("mouseHoldToggle").addEventListener("mouseup", holdToggle, true); document.getElementById("mouseHoldToggle").addEventListener("mouseup", holdToggle, true);

View File

@ -31,6 +31,9 @@
<li class="list-group-item" style="width: 100%;"> <li class="list-group-item" style="width: 100%;">
<button id="pressEnterBtn" class="btn btn-success btn-lg">Enter</button> <button id="pressEnterBtn" class="btn btn-success btn-lg">Enter</button>
</li> </li>
<li class="list-group-item" style="width: 100%;">
<button id="pressBackBtn" class="btn btn-success btn-lg">Backspace</button>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -67,6 +70,12 @@
<div class="col"> <div class="col">
<ul class="navbar-nav"> <ul class="navbar-nav">
<li class="list-group-item">
<a href="/sound-manager">
<button class="btn btn-success btn-lg">Sound Manager</button>
</a>
</li>
<li id="hideHandler" class="list-group-item"> <li id="hideHandler" class="list-group-item">
<button id="scrollToggle" class="btn btn-success btn-lg">Scroll Mode: Inactive</button> <button id="scrollToggle" class="btn btn-success btn-lg">Scroll Mode: Inactive</button>
</li> </li>

View File

@ -2,6 +2,7 @@
<html lang="en" dir="ltr"> <html lang="en" dir="ltr">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=0.5, maximum-scale=0.5, user-scalable=no" />
{% if title %} {% if title %}
<title>{{title}}</title> <title>{{title}}</title>
{% else %} {% else %}