dinput: Fix remaining formatting of the find_joydevs().
This commit is contained in:
parent
a610cfb64c
commit
8b09a8eb9d
|
@ -265,14 +265,17 @@ static void find_joydevs(void)
|
|||
|
||||
/* A true joystick has at least axis X and Y, and at least 1
|
||||
* button. copied from linux/drivers/input/joydev.c */
|
||||
if (test_bit(joydev.absbits,ABS_X) && test_bit(joydev.absbits,ABS_Y) &&
|
||||
( test_bit(joydev.keybits,BTN_TRIGGER) ||
|
||||
if (!test_bit(joydev.absbits, ABS_X) || !test_bit(joydev.absbits, ABS_Y) ||
|
||||
!(test_bit(joydev.keybits, BTN_TRIGGER) ||
|
||||
test_bit(joydev.keybits, BTN_A) ||
|
||||
test_bit(joydev.keybits,BTN_1)
|
||||
)
|
||||
) {
|
||||
test_bit(joydev.keybits, BTN_1)))
|
||||
{
|
||||
close(fd);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!(joydev.device = HeapAlloc(GetProcessHeap(), 0, strlen(buf) + 1))) {
|
||||
if (!(joydev.device = HeapAlloc(GetProcessHeap(), 0, strlen(buf) + 1)))
|
||||
{
|
||||
close(fd);
|
||||
continue;
|
||||
}
|
||||
|
@ -305,9 +308,11 @@ static void find_joydevs(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
for (j=0;j<ABS_MAX;j++) {
|
||||
if (test_bit(joydev.absbits,j)) {
|
||||
if (-1!=ioctl(fd,EVIOCGABS(j),&(joydev.axes[j]))) {
|
||||
for (j = 0; j < ABS_MAX;j ++)
|
||||
{
|
||||
if (!test_bit(joydev.absbits, j)) continue;
|
||||
if (ioctl(fd, EVIOCGABS(j), &(joydev.axes[j])) != -1)
|
||||
{
|
||||
TRACE(" ... with axis %d: cur=%d, min=%d, max=%d, fuzz=%d, flat=%d\n",
|
||||
j,
|
||||
joydev.axes[j].value,
|
||||
|
@ -318,7 +323,6 @@ static void find_joydevs(void)
|
|||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!have_joydevs)
|
||||
new_joydevs = HeapAlloc(GetProcessHeap(), 0, sizeof(struct JoyDev));
|
||||
|
@ -333,7 +337,6 @@ static void find_joydevs(void)
|
|||
joydevs = new_joydevs;
|
||||
memcpy(joydevs + have_joydevs, &joydev, sizeof(joydev));
|
||||
have_joydevs++;
|
||||
}
|
||||
|
||||
close(fd);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue