Don't return -1 on keyboard read failure
This commit is contained in:
parent
e44b4f43f0
commit
eb7e142b67
|
@ -244,43 +244,36 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Keyboard_nRead
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return num_events;
|
|
||||||
} else if (ret == DI_BUFFEROVERFLOW) {
|
} else if (ret == DI_BUFFEROVERFLOW) {
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
printf("Keyboard buffer overflowed\n");
|
printf("Keyboard buffer overflowed\n");
|
||||||
#endif
|
#endif
|
||||||
return -1;
|
|
||||||
} else if (ret == DIERR_INPUTLOST) {
|
} else if (ret == DIERR_INPUTLOST) {
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
printf("Input lost\n");
|
printf("Input lost\n");
|
||||||
#endif
|
#endif
|
||||||
return -1;
|
|
||||||
} else if (ret == DIERR_NOTACQUIRED) {
|
} else if (ret == DIERR_NOTACQUIRED) {
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
printf("not acquired\n");
|
printf("not acquired\n");
|
||||||
#endif
|
#endif
|
||||||
return -1;
|
|
||||||
} else if (ret == DIERR_INVALIDPARAM) {
|
} else if (ret == DIERR_INVALIDPARAM) {
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
printf("invalid parameter\n");
|
printf("invalid parameter\n");
|
||||||
#endif
|
#endif
|
||||||
return -1;
|
|
||||||
} else if (ret == DIERR_NOTBUFFERED) {
|
} else if (ret == DIERR_NOTBUFFERED) {
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
printf("not buffered\n");
|
printf("not buffered\n");
|
||||||
#endif
|
#endif
|
||||||
return -1;
|
|
||||||
} else if (ret == DIERR_NOTINITIALIZED) {
|
} else if (ret == DIERR_NOTINITIALIZED) {
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
printf("not inited\n");
|
printf("not inited\n");
|
||||||
#endif
|
#endif
|
||||||
return -1;
|
|
||||||
} else {
|
} else {
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
printf("unknown keyboard error\n");
|
printf("unknown keyboard error\n");
|
||||||
#endif
|
#endif
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
return num_events;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue