46 lines
986 B
HTML
46 lines
986 B
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Mouse remote</title>
|
|
<style>
|
|
</style>
|
|
<script src="https://code.jquery.com/jquery-3.5.0.js"></script>
|
|
</head>
|
|
<body>
|
|
HID mouse service, POST data to /mouse <br/>
|
|
<div>
|
|
</div>
|
|
|
|
<input type="button" onclick="sendMouse(0, 0, -10);" value="^" />
|
|
<input type="button" onclick="sendMouse(0, -10, 0);" value="<" />
|
|
<input type="button" onclick="sendMouse(0, 10, 0);" value=">" />
|
|
<input type="button" onclick="sendMouse(0, 0, 10);" value="v" /><br />
|
|
<input type="button" onclick="sendMouse(1, 0, 0);" value="LEFT" />
|
|
<input type="button" onclick="sendMouse(2, 0, 0);" value="RIGHT" />
|
|
|
|
<script>
|
|
|
|
function sendMouse(btn, x, y) {
|
|
var obj = {
|
|
x: x,
|
|
y: y,
|
|
btn: btn,
|
|
wheel: 0,
|
|
}
|
|
|
|
var ret = $.ajax({
|
|
type: "POST",
|
|
url: "hid/mouse",
|
|
data: JSON.stringify(obj),
|
|
contentType: "application/json; charset=utf-8",
|
|
dataType: "json"
|
|
});
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|