Skip to content

Commit

Permalink
Fix IOS9
Browse files Browse the repository at this point in the history
  • Loading branch information
hjmmc committed Mar 13, 2018
1 parent 08ed37e commit cd55a31
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Double click Gyro.exe

Run Cemu.exe and Checked Options->GamePad mation source->DSU1->By Slot

Use your phone browser open http://your.pc.ip:8080 (example http://192.168.1.100:8080)
Use your phone's browser (safair or chrome) open http://your.pc.ip:8080 (example http://192.168.1.100:8080)

Load the game and enjoy it~

Expand Down
4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,14 +333,14 @@ http
.listen(8080, function() {
console.log(`
----------------------------------------
Version 1.3 by hjmmc
Version 1.4 by hjmmc
-----------------------------------------
##Usage
1.Run Cemu.exe and Checked Options->GamePad mation source->DSU1->By Slot
2.Use your phone browser open the following url`);
2.Use your phone‘s browser (safair or chrome) open the following url`);
var interfaces = require("os").networkInterfaces();
for (var k in interfaces) {
for (var i in interfaces[k]) {
Expand Down
20 changes: 10 additions & 10 deletions static.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
<title>Gyro Client</title>
</head>
<body>
<p>Version: 1.3 (by hjmmc)</p>
<p>Version: 1.4 (by hjmmc)</p>
<p>Tips:Please keep the screen bright when you use it.</p>
<div>
Sensitivity:<input id="scale" type="number" onchange="scaleChange(this.value)" value=""><br>
Sensitivity:<input id="scale" type="number" onchange="scaleChange(this.value)" value="1"><br>
Screen direction:
<select id="screen" onchange="screenChange(this.value)">
<option value="h">horizontal</option>
<option value="v">vertical</option>
</select>
</div>
<p>WebSocket State:<label id="lblConnected">Connected</label></p>
<p>WebSocket State:<label id="lblConnected">Disconnecte</label></p>
<p id="x">x:0</p>
<p id="y">y:0</p>
<p id="z">z:0</p>
Expand Down Expand Up @@ -47,15 +47,15 @@
console.log(wsAddress);
var ws = new WebSocket(wsAddress);
ws.onopen = function(ws_evnt) {
window.document.getElementById("lblConnected").textContent = "已连接";
window.document.getElementById("lblConnected").textContent = "Connected";
window.ondevicemotion = function(motion) {
//x(red) z(blue) y(green)
let gyroV = {
var gyroV = {
x: scale * motion.rotationRate.alpha,
z: scale * motion.rotationRate.beta,
y: -scale * motion.rotationRate.gamma,
}
let gyroH = {
var gyroH = {
z: scale * motion.rotationRate.alpha,
x: -scale * motion.rotationRate.beta,
y: -scale * motion.rotationRate.gamma,
Expand All @@ -64,8 +64,8 @@
document.getElementById("x").textContent = 'x:' + gyroV.x
document.getElementById("y").textContent = 'y:' + gyroV.y
document.getElementById("z").textContent = 'z:' + gyroV.z
document.getElementById("s").textContent = '当前灵敏度:' + scale
let data = {
document.getElementById("s").textContent = 'Current Sensitivity:' + scale
var data = {
ts: parseInt(Date.now() * 1000),
gyro: screen == 'v' ? gyroV : gyroH,
acceleration: {
Expand All @@ -81,8 +81,8 @@
};

ws.onclose = function() {
alert('连接已断开,请刷新界面重试')
window.document.getElementById("lblConnected").textContent = "连接已断开!请刷新界面重试。";
alert('WebSocket is Disconnecte! Please refresh this page and retry it.')
window.document.getElementById("lblConnected").textContent = "WebSocket is closed! Please refresh this page and retry it.";
}
</script>
</html>

0 comments on commit cd55a31

Please sign in to comment.