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

View File

@ -1,4 +1,5 @@
# Python imports
import subprocess
# Lib imports
import pyautogui
@ -30,6 +31,26 @@ def home():
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>')
def updateCoords2(x, y):
try:

View File

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

View File

@ -142,6 +142,11 @@ function pressEnter() {
socket.emit('press_enter', "");
}
function pressBack() {
socket.emit('press_back', "");
}
function scrollToggle() {
if (isScrolling) {
isScrolling = false;
@ -190,12 +195,12 @@ $( "#typingModalBtn" ).bind( "mouseup", async function(eve) {
$( "#closeControlsModalBtn" ).bind( "mouseup", async function(eve) {
console.log("here");
$('#controlsModal').modal({"focus": false, "show": false});
$('#controlsModal').modal('hide');
});
$( "#closeTypingModalBtn" ).bind( "mouseup", async function(eve) {
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("sendKeysBtn").addEventListener("mouseup", sendKeys, true);
document.getElementById("pressEnterBtn").addEventListener("mouseup", pressEnter, true);
document.getElementById("pressBackBtn").addEventListener("mouseup", pressBack, true);
document.getElementById("scrollToggle").addEventListener("mouseup", scrollToggle, true);
document.getElementById("mouseHoldToggle").addEventListener("mouseup", holdToggle, true);

View File

@ -31,6 +31,9 @@
<li class="list-group-item" style="width: 100%;">
<button id="pressEnterBtn" class="btn btn-success btn-lg">Enter</button>
</li>
<li class="list-group-item" style="width: 100%;">
<button id="pressBackBtn" class="btn btn-success btn-lg">Backspace</button>
</li>
</ul>
</div>
</div>
@ -67,6 +70,12 @@
<div class="col">
<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">
<button id="scrollToggle" class="btn btn-success btn-lg">Scroll Mode: Inactive</button>
</li>

View File

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