aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorepoch <epoch@enzo.thebackupbox.net>2020-11-18 00:35:04 -0600
committerepoch <epoch@enzo.thebackupbox.net>2020-11-18 00:35:04 -0600
commit6241f5a8627632242b7cf613bdc0a296ed85b35e (patch)
treeb4aa99b33d3ab1935f6f6869142f4e0aa25e248f
parent91e1d05c3f73db1662b58e7387a017dd3b0d011d (diff)
downloadhackvr-6241f5a8627632242b7cf613bdc0a296ed85b35e.tar.gz
hackvr-6241f5a8627632242b7cf613bdc0a296ed85b35e.zip
added wiimote test because... I dump lots of crap into this repo.
-rw-r--r--tests/wiimote.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/wiimote.c b/tests/wiimote.c
new file mode 100644
index 0000000..229f920
--- /dev/null
+++ b/tests/wiimote.c
@@ -0,0 +1,27 @@
+#include <stdio.h>
+#include <sys/time.h>
+
+struct input_event{//totals to 24
+ struct timeval time;
+ unsigned short type;
+ unsigned short code;
+ unsigned int state;
+};
+
+int main(int argc,char *argv[]) {
+ int i;
+ struct input_event ie;
+ int x,y,z;
+ while(!feof(stdin)) {
+ read(0,&ie,sizeof(struct input_event));
+ printf("type: %d :: ",ie.type);
+ if(ie.code == 3) x=ie.state;
+ if(ie.code == 4) y=ie.state;
+ if(ie.code == 5) z=ie.state;
+ printf("%15d %15d %15d",x,y,z);
+ //for(i=0;i<16;i++) {
+ // printf(" %02x",(unsigned char)ae.derp[i]);
+ //}
+ printf("\n");
+ }
+}