-
Notifications
You must be signed in to change notification settings - Fork 0
/
input.html
99 lines (81 loc) · 4.22 KB
/
input.html
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Remote Control Input</title>
<style>
:root {color-scheme: dark;}
#screen-container {
background: white;
padding: 1px;
display: inline-block;
position: relative;
}
</style>
</head>
<body>
<h1>Type - typewrite()</h1>
<form action="/type" method="POST">
<input name="totype" type="text">
<input type="submit">
</form>
<h1>Move Mouse - moveTo()</h1>
<form action="/movemouse" method="POST">
<label>X</label> <input name="x" type="number">
<label>Y</label> <input name="y" type="number">
<input type="submit">
</form>
<h1>Press - press()</h1>
<form action="/press" method="POST">
<label>To press </label>
<input name="topress" type="text">
<input type="submit">
</form>
<h1>Hotkey (seperate with ",") - hotkey() </h1>
<form action="/hotkey" method="POST">
<label>To hotkey </label>
<input name="tohotkey" type="text">
<input type="submit">
</form>
<br> <br>
<button onclick="m_click(0)">Left Click</button>
<button onclick="m_click(1)">Scroll Wheel Button Click</button>
<button onclick="m_click(2)">Right Click</button>
<h1>Screen</h1>
<div id="screen-coordinate-viewer"></div>
<div id="screen-container">
<img id="screen-img" onclick="updateScreenCoordinates()" onmousemove="updateScreenCoordinates()" src="./screen.png" ismap>
</div>
<h1>Reference: </h1>
<div> Keys:
['\T', '\n', '\r', ' ', '!', '"', '#', '$', '%', '&', "'", '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@', '[', '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e','f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~', 'accept', 'add', 'alt', 'altleft', 'altright', 'apps', 'backspace', 'browserback', 'browserfavorites', 'browserforward', 'browserhome', 'browserrefresh', 'browsersearch', 'browserstop', 'capslock', 'clear', 'convert', 'ctrl', 'ctrlleft', 'ctrlright', 'decimal', 'del', 'delete', 'divide', 'down', 'end', 'enter', 'esc', 'escape', 'execute', 'f1', 'f10', 'f11', 'f12', 'f13', 'f14', 'f15', 'f16', 'f17', 'f18', 'f19', 'f2', 'f20', 'f21', 'f22', 'f23', 'f24', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'final', 'fn', 'hanguel', 'hangul', 'hanja', 'help', 'home', 'insert', 'junja', 'kana', 'kanji', 'launchapp1', 'launchapp2', 'launchmail', 'launchmediaselect', 'left', 'modechange', 'multiply', 'nexttrack', 'nonconvert', 'num0', 'num1', 'num2', 'num3', 'num4', 'num5', 'num6', 'num7', 'num8', 'num9', 'numlock', 'pagedown', 'pageup', 'pause', 'pgdn', 'pgup', 'playpause', 'prevtrack', 'print', 'printscreen', 'prntscrn', 'prtsc', 'prtscr', 'return', 'right', 'scrolllock', 'select', 'separator', 'shift', 'shiftleft', 'shiftright', 'sleep', 'space', 'stop', 'subtract', 'tab', 'up', 'volumedown', 'volumemute', 'volumeup', 'win', 'winleft', 'winright', 'yen', 'command', 'option', 'optionleft', 'optionright']
</div>
<script>
console.log("JS loaded");
function m_click(btn) {
console.log("Clicking...")
// btn: int
// 0 - left mouse button
// 1 - middle mouse button
// 2 - right mouse button
var fetchURL = "/click";
if (btn == 0) fetchURL += "left";
else if (btn == 1) fetchURL += "middle";
else if (btn == 2) fetchURL += "right";
fetch(fetchURL, {
method: "POST"
});
window.location.reload();
}
var coordinateViewer = document.getElementById("screen-coordinate-viewer");
var screenImg = document.getElementById("screen-img");
function updateScreenCoordinates(ev) {
var xCoordinate = event.offsetX;
var yCoordinate = event.offsetY;
coordinateViewer.innerText = `x=${xCoordinate}; y=${yCoordinate}`;
}
</script>
</body>
</html>