Don't return -1 on keyboard read failure

This commit is contained in:
Elias Naur 2003-02-12 09:55:17 +00:00
parent e44b4f43f0
commit eb7e142b67
1 changed files with 1 additions and 8 deletions

View File

@ -244,43 +244,36 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Keyboard_nRead
}
}
}
return num_events;
} else if (ret == DI_BUFFEROVERFLOW) {
#ifdef _DEBUG
printf("Keyboard buffer overflowed\n");
#endif
return -1;
} else if (ret == DIERR_INPUTLOST) {
#ifdef _DEBUG
printf("Input lost\n");
#endif
return -1;
} else if (ret == DIERR_NOTACQUIRED) {
#ifdef _DEBUG
printf("not acquired\n");
#endif
return -1;
} else if (ret == DIERR_INVALIDPARAM) {
#ifdef _DEBUG
printf("invalid parameter\n");
#endif
return -1;
} else if (ret == DIERR_NOTBUFFERED) {
#ifdef _DEBUG
printf("not buffered\n");
#endif
return -1;
} else if (ret == DIERR_NOTINITIALIZED) {
#ifdef _DEBUG
printf("not inited\n");
#endif
return -1;
} else {
#ifdef _DEBUG
printf("unknown keyboard error\n");
#endif
return -1;
}
return num_events;
}
/*