Skip to content

Commit 31264cf

Browse files
committed
Merge branch 'master' of github.com:harsh2204/socketjoy
2 parents 95829cb + 6904757 commit 31264cf

File tree

2 files changed

+37
-6
lines changed

2 files changed

+37
-6
lines changed

README.md

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,48 @@
11
## SocketJoy
22

3-
**Note** : This project is currently only being tested on linux (and may not work on windows). Once the frontend implementation is done, I'll start testing on windows.
4-
53
Use your mobile phone as a virtual xbox controller for your windows or linux pc!
64

75
This project relies on work done by @qbolec with [joydiv](https://github.com/qbolec/Joydiv) and the [j2dx](https://github.com/OzymandiasTheGreat/Joy2DroidX-server/) server written by @OzymandiasTheGreat, so huge thanks to them!
86

9-
### Install Script:
7+
### Quickstart
8+
9+
#### Windows
10+
11+
__Server:__
12+
```
13+
wget https://github.com/OzymandiasTheGreat/Joy2DroidX-server/releases/download/v0.1.0/Joy2DroidX-server-0.1.0-x86_64.exe
14+
```
15+
16+
Or simply download and run this server [executable](https://github.com/OzymandiasTheGreat/Joy2DroidX-server/releases/download/v0.1.0/Joy2DroidX-server-0.1.0-x86_64.exe)
17+
18+
Note that you can run the exe in a cmd terminal and pass in `-d` to enable debugging on the server side.
19+
```
20+
Joy2DroidX-server-0.1.0-x86_64.exe -d
21+
```
22+
(Note that the qr code and address output from this command is for the j2dx server which the client connects to. Incase the default server address in `socketjoy.js` is different from the one provided in the output, just update the address in `socketjoy.js` or manually enter the address on your smartphone by clicking the cog button)
23+
24+
__Client:__
25+
26+
```
27+
git clone https://github.com/harsh2204/socketjoy.git
28+
cd socketjoy
29+
python3 -m http.server
30+
```
31+
32+
Connect to the __client__ address with the correct port to complete the quickstart.
33+
34+
---
35+
36+
#### Linux:
37+
1038
The following script is a quick way to get the server and client up and running with one command. The server and client will be installed in a directory called `virtual-controller`.
1139
```
1240
bash <(curl -s https://gist.githubusercontent.com/harsh2204/ad0edf5ef6298464fb5f6d50bd01196f/raw)
1341
```
1442

1543
To run the server again you can simply go into `virtual-controller/socket-joy` and run `./run.sh`.
16-
### Manual Setup and Deploymet Steps:
44+
45+
### Manual Setup and Deployment Steps:
1746

1847
* install j2dx plugin and set it up. See instuctions [from my fork](https://github.com/harsh2204/Joy2DroidX-server) or [here](https://github.com/OzymandiasTheGreat/Joy2DroidX-server/#installation)
1948
* edit socketjoy.js to open the socket at the local IP address of your machine on line. Alternatively, you can also do this in the browser after you connect you smartphone..

socketjoy.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,12 @@ if (isLocal) {
223223
document.getElementsByTagName("img")[0].style.filter = "invert(0)";
224224
}, 5000);
225225
});
226-
226+
// Prevent conext menu from popping up on long press
227+
window.addEventListener("contextmenu", function(e) { e.preventDefault(); });
228+
227229
setTimeout(() =>{
228230
if (CONNECTED == false){
229231
conf[0].click();
230232
}
231233
}, 500);
232-
}
234+
}

0 commit comments

Comments
 (0)