1
Provide a jskeepalive program to prevent Acrux gamepads from
3
https://bugs.launchpad.net/ubuntu/+source/joystick/+bug/448446 for
6
--- joystick-20051019.orig/utils/Makefile
7
+++ joystick-20051019/utils/Makefile
9
CFLAGS = -g -O2 -Wall -I../linux/include
11
PROGRAMS = evtest inputattach jstest jscal fftest ffmvforce ffset \
12
- ffcfstress # acceltest
13
+ ffcfstress jskeepalive # acceltest
19
acceltest: acceltest.c
20
$(CC) $(CFLAGS) $(CPPFLAGS) -lm $^ -o $@
22
+jskeepalive: jskeepalive.c
23
+ $(CC) $(CFLAGS) $(CPPFLAGS) $^ -o $@
25
+++ joystick-20051019/utils/jskeepalive.c
28
+ * jskeepalive.c Version 1.0
30
+ * Copyright © 2010 Stephen Kitt
36
+ * This program is free software; you can redistribute it and/or
37
+ * modify it under the terms of the GNU General Public License as
38
+ * published by the Free Software Foundation; either version 2 of the
39
+ * License, or (at your option) any later version.
41
+ * This program is distributed in the hope that it will be useful, but
42
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
43
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
44
+ * General Public License for more details.
46
+ * You should have received a copy of the GNU General Public License
47
+ * along with this program; if not, write to the Free Software
48
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
51
+ * Should you need to contact me, the author, you can do so by email
52
+ * at <steve@sk2.org>.
60
+#include <linux/joystick.h>
62
+int main (int argc, char **argv)
67
+ if (argc != 2 || !strcmp("--help", argv[1])) {
69
+ puts("Usage: jskeepalive <device>");
74
+ if ((fd = open(argv[argc - 1], O_RDONLY)) < 0) {
75
+ perror("jskeepalive");
80
+ if (read(fd, &js, sizeof(struct js_event)) != sizeof(struct js_event)) {
81
+ perror("\njskeepalive: error reading");