Fixed git clone URL
[sixth-3d.git] / src / main / java / eu / svjatoslav / sixth / e3d / gui / humaninput / Connexion3D.java
1 /*
2  * Sixth 3D engine. Author: Svjatoslav Agejenko.
3  * This project is released under Creative Commons Zero (CC0) license.
4  */
5 package eu.svjatoslav.sixth.e3d.gui.humaninput;
6
7 import java.io.BufferedReader;
8 import java.io.FileReader;
9 import java.io.IOException;
10
11 /**
12  * I have Space Mouse Compact 3D Connexion mouse: https://3dconnexion.com/us/product/spacemouse-compact/
13  *
14  * I discovered that it is possible to read raw data from it by reading /dev/hidraw4 file.
15  *
16  * TODO: reverse engineer the data format and implement a driver for it.
17  */
18
19 public class Connexion3D {
20
21     public static void main(final String[] args) throws IOException {
22
23         final BufferedReader in = new BufferedReader(new FileReader(
24                 "/dev/hidraw4"));
25
26
27         // for testing purposes
28         while (true) {
29             System.out.print(in.read() + " ");
30             System.out.println("\n");
31         }
32
33         // in.close();
34
35     }
36 }