mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-04-17 12:24:07 +00:00
Windows: Restore the old ToAscii code used on win9x platforms in an attempt to fix broken keyboard input on win98se machines.
This commit is contained in:
parent
dedfaea500
commit
9f7da6d483
2 changed files with 46 additions and 4 deletions
|
|
@ -45,12 +45,26 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsKeyboard_MapVirtualKey(JNIEn
|
|||
return MapVirtualKey(uCode, uMapType);
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_WindowsKeyboard_isWindowsNT(JNIEnv *env, jclass unused) {
|
||||
OSVERSIONINFO osvi;
|
||||
|
||||
osvi.dwOSVersionInfoSize = sizeof(osvi);
|
||||
GetVersionEx(&osvi);
|
||||
return osvi.dwPlatformId == VER_PLATFORM_WIN32_NT ? JNI_TRUE : JNI_FALSE;
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsKeyboard_ToUnicode(JNIEnv *env, jclass unused, jint wVirtKey, jint wScanCode, jobject lpKeyState_obj, jobject pwszBuff_obj, jint cchBuff, jint flags) {
|
||||
const PBYTE lpKeyState = (*env)->GetDirectBufferAddress(env, lpKeyState_obj);
|
||||
LPWSTR pwszBuff = (*env)->GetDirectBufferAddress(env, pwszBuff_obj);
|
||||
return ToUnicode(wVirtKey, wScanCode, lpKeyState, pwszBuff, cchBuff, flags);
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsKeyboard_ToAscii(JNIEnv *env, jclass unused, jint wVirtKey, jint wScanCode, jobject lpKeyState_obj, jobject lpChar_obj, jint flags) {
|
||||
const PBYTE lpKeyState = (*env)->GetDirectBufferAddress(env, lpKeyState_obj);
|
||||
LPWORD lpChar = (*env)->GetDirectBufferAddress(env, lpChar_obj);
|
||||
return ToAscii(wVirtKey, wScanCode, lpKeyState, lpChar, flags);
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsKeyboard_GetKeyboardState(JNIEnv *env, jclass unused, jobject lpKeyState_obj) {
|
||||
PBYTE lpKeyState = (*env)->GetDirectBufferAddress(env, lpKeyState_obj);
|
||||
return GetKeyboardState(lpKeyState);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue