Skip to content

Commit

Permalink
Release v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AmirSavand committed Apr 6, 2022
0 parents commit a0fdde9
Show file tree
Hide file tree
Showing 25 changed files with 1,050 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
root = true

[*]
charset = utf-8
end_of_line = crlf
indent_size = 4
indent_style = space
insert_final_newline = true
max_line_length = 120
tab_width = 4

ij_javascript_force_quote_style = true
ij_javascript_use_double_quotes = false
ij_javascript_force_semicolon_style = true

[*.js]
indent_size = 2

[*.json]
indent_size = 2

[*.css]
indent_size = 2

[*.html]
indent_size = 2
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.idea/
output/
venv/
__pycache__/
*.pyc
file_version_info.txt
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Mouseee

Control your mouse from your phone in the faster way possible.

## Installation

Download the latest release on your computer (device you want to control).

## Usage

Run the `Mouseee.exe` file, and you should see the local network address to visit via phone browser.

## Features

- Move your computer mouse with your phone.
- Tap to click and tab with 2 fingers to right-click.

## Contact Us

Email us at hello@savandbros.com and share your experience or feedback.

## Built with

Here's a list of cool things made Mouseee possible.

- [Python](https://www.python.org/)
- [JetBrains](https://www.jetbrains.com/)
- [PyCharm](https://www.jetbrains.com/pycharm/)

## About

Made with 💖 by [Savand Bros](https://savandbros.com) © 2022.
1 change: 1 addition & 0 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "1.0.0"
37 changes: 37 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from os import getcwd, path

import mouse
from flask import Flask, render_template, json
from flask_sock import Sock

from __init__ import __version__


def get_path(file: str):
return path.join(getcwd(), file)


app = Flask(__name__, template_folder=get_path("templates"), static_folder=get_path("static"))
app.config.from_file(get_path("config.json"), load=json.load)

sock = Sock(app)


@app.route("/")
def index():
return render_template("index.html")


@sock.route("/")
def handle(instance):
while True:
data = json.loads(instance.receive())
if data["event"] == "click":
mouse.click(data["data"]["button"])
elif data["event"] == "move":
mouse.move(data["data"]["x"], data["data"]["y"], False)


if __name__ == "__main__":
print(f"Mouseee v{__version__}\n")
app.run(host="0.0.0.0", port=5555)
109 changes: 109 additions & 0 deletions bin/build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
"version": "auto-py-to-exe-configuration_v1",
"pyinstallerOptions": [
{
"optionDest": "noconfirm",
"value": true
},
{
"optionDest": "filenames",
"value": "C:/dev/AmirSavand/mouseee/app.py"
},
{
"optionDest": "onefile",
"value": false
},
{
"optionDest": "console",
"value": true
},
{
"optionDest": "icon_file",
"value": "C:/dev/AmirSavand/mouseee/static/icon.ico"
},
{
"optionDest": "name",
"value": "Mouseee"
},
{
"optionDest": "ascii",
"value": false
},
{
"optionDest": "clean_build",
"value": true
},
{
"optionDest": "loglevel",
"value": "INFO"
},
{
"optionDest": "strip",
"value": false
},
{
"optionDest": "noupx",
"value": false
},
{
"optionDest": "disable_windowed_traceback",
"value": false
},
{
"optionDest": "version_file",
"value": "C:/dev/AmirSavand/mouseee/file_version_info.txt"
},
{
"optionDest": "embed_manifest",
"value": true
},
{
"optionDest": "uac_admin",
"value": false
},
{
"optionDest": "uac_uiaccess",
"value": false
},
{
"optionDest": "win_private_assemblies",
"value": false
},
{
"optionDest": "win_no_prefer_redirects",
"value": false
},
{
"optionDest": "bootloader_ignore_signals",
"value": false
},
{
"optionDest": "datas",
"value": "C:/dev/AmirSavand/mouseee/static;static/"
},
{
"optionDest": "datas",
"value": "C:/dev/AmirSavand/mouseee/templates;templates/"
},
{
"optionDest": "datas",
"value": "C:/dev/AmirSavand/mouseee/config.json;."
},
{
"optionDest": "datas",
"value": "C:/dev/AmirSavand/mouseee/README.md;."
},
{
"optionDest": "datas",
"value": "C:/dev/AmirSavand/mouseee/LICENSE;."
},
{
"optionDest": "datas",
"value": "C:/dev/AmirSavand/mouseee/__init__.py;."
}
],
"nonPyinstallerOptions": {
"increaseRecursionLimit": true,
"manualArguments": ""
}
}
5 changes: 5 additions & 0 deletions bin/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
./version.sh &&\
cd .. &&\
echo "Opening builder" &&\
auto-py-to-exe --config=bin/build.json &&\
echo "Built into dir (/output/Mouseee/)"
4 changes: 4 additions & 0 deletions bin/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
echo "Cleaning build output" &&\
rm -rf ../output &&\
echo "Cleaning version file" &&\
rm -rf ../file_version_info.txt
2 changes: 2 additions & 0 deletions bin/version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
echo "Generating version file" &&\
create-version-file version.yml --outfile ../file_version_info.txt
7 changes: 7 additions & 0 deletions bin/version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Version: 1.0.0.0
CompanyName: Savand Bros
FileDescription: Control your mouse from your phone in the faster way possible.
InternalName: Mouseee
LegalCopyright: Savand Bros © 2022
OriginalFilename: Mouseee.exe
ProductName: Mouseee
4 changes: 4 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"ENVIRONMENT": "production",
"TESTING": false
}
4 changes: 4 additions & 0 deletions requirements.dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-r requirements.txt

auto-py-to-exe==2.18.1
pyinstaller-versionfile==2.0.0
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Flask==2.1.1
Jinja2==3.1.1
flask-sock==0.5.2
mouse==0.7.1
Binary file added static/icon.ico
Binary file not shown.
Binary file added static/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/manifest/icon-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/manifest/icon-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/manifest/icon-384x384.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/manifest/icon-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions static/manifest/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"theme_color": "#00A885",
"background_color": "#00A885",
"display": "fullscreen",
"scope": "/",
"start_url": "/",
"name": "Mouseee",
"short_name": "Mouseee",
"author": "Savand Bros",
"description": "Control your mouse from your phone in the faster way possible.",
"icons": [
{
"src": "/static/manifest/icon-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/static/manifest/icon-256x256.png",
"sizes": "256x256",
"type": "image/png"
},
{
"src": "/static/manifest/icon-384x384.png",
"sizes": "384x384",
"type": "image/png"
},
{
"src": "/static/manifest/icon-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}
50 changes: 50 additions & 0 deletions static/scripts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
window.addEventListener('load', () => {
console.log('Remoteee Web v1.0.0');

const sensor = document.querySelector('#sensor');
const ws = new WebSocket(`ws://${location.host}`);
const touch = {
start: {x: 0, y: 0},
};
const send = (event, data) => {
ws.send(JSON.stringify({event, data}));
};

ws.addEventListener('open', () => {
console.debug('Connected to server');
sensor.classList.add('on');
sensor.classList.remove('off');
});

ws.addEventListener('close', (event) => {
console.debug(`Disconnected from server (code ${event.code})`);
sensor.classList.remove('on');
sensor.classList.add('off');
});

sensor.addEventListener('click', () => {
send('click', {button: 'left'});
});

sensor.addEventListener('touchstart', (event) => {
touch.start.x = event.touches[0].screenX;
touch.start.y = event.touches[0].screenY;

if (event.touches.length === 2) {
send('click', {button: 'right'});
}
});

sensor.addEventListener('touchmove', (event) => {
const data = {
x: (event.changedTouches[0].screenX - touch.start.x) * 1.8,
y: (event.changedTouches[0].screenY - touch.start.y) * 1.8,
};
if (!data.x && !data.y) {
return;
}
send('move', data);
touch.start.x = event.touches[0].screenX;
touch.start.y = event.touches[0].screenY;
});
});
33 changes: 33 additions & 0 deletions static/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
html {
touch-action: manipulation;
}

body {
overscroll-behavior: contain;
}

html,
body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}

#sensor {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #00A885;
border: none;
border-radius: 0;
padding: 0;
margin: 0;
}

#sensor.off {
pointer-events: none;
touch-action: none;
}
17 changes: 17 additions & 0 deletions templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
<meta content="ie=edge" http-equiv="X-UA-Compatible">
<meta name="theme-color" content="#00A885">
<link rel="icon" type="image/png" sizes="1024x1024" href="/static/icon.png">
<link href="/static/styles.css" rel="stylesheet">
<link rel="manifest" href="/static/manifest/manifest.json">
<title>Mouseee</title>
</head>
<body>
<button class="off" id="sensor"></button>
<script src="/static/scripts.js"></script>
</body>
</html>

0 comments on commit a0fdde9

Please sign in to comment.