Update example, use /dev/input/js0, the first joystick

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2018-05-31 23:37:39 +02:00
1 parent 951f959549
commit c4ac2eae5d
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -312,7 +312,7 @@ int main(void)
uev_t watcher; uev_t watcher;
uev_ctx_t ctx; uev_ctx_t ctx;
fd = open("/dev/input/js1", O_RDONLY, O_NONBLOCK); fd = open("/dev/input/js0", O_RDONLY, O_NONBLOCK);
if (fd < 0) if (fd < 0)
errx(errno, "Cannot find a joystick attached."); errx(errno, "Cannot find a joystick attached.");
+1 -1
View File
@@ -78,7 +78,7 @@ int main(void)
uev_t js1_watcher; uev_t js1_watcher;
uev_ctx_t ctx; uev_ctx_t ctx;
fd = open("/dev/input/js1", O_RDONLY, O_NONBLOCK); fd = open("/dev/input/js0", O_RDONLY, O_NONBLOCK);
if (fd < 0) if (fd < 0)
errx(errno, "Cannot find a joystick attached."); errx(errno, "Cannot find a joystick attached.");