-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
41 lines (32 loc) · 701 Bytes
/
main.py
File metadata and controls
41 lines (32 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from flask import *
from pynput.mouse import Button, Controller
app = Flask("remoteMouse")
mouse = Controller()
@app.route("/rmb")
def rmb_c():
mouse.click(Button.right)
return "ok"
@app.route("/lmb")
def lmb_c():
mouse.click(Button.left)
return "ok"
@app.route("/rmb_h")
def rmb_h():
mouse.press(Button.right)
return "ok"
@app.route("/rmb_r")
def rmb_r():
mouse.release(Button.right)
return "ok"
@app.route("/lmb_h")
def lmb_h():
mouse.press(Button.left)
return "ok"
@app.route("/lmb_r")
def lmb_r():
mouse.release(Button.left)
return "ok"
@app.route("/")
def index():
return render_template("index.html")
app.run(host="0.0.0.0", port=80)