From 7c34e2cddb1eab22ae20a33761fb52bf619d0459 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Tue, 30 May 2006 08:48:16 +0000 Subject: [PATCH] Win32: Track directinput mouse buttons in the windows message state array. This should avoid some problems when switching from grabbed to non-grabbed --- src/native/win32/org_lwjgl_input_Mouse.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/native/win32/org_lwjgl_input_Mouse.c b/src/native/win32/org_lwjgl_input_Mouse.c index 90c5e8b7..26dbd707 100644 --- a/src/native/win32/org_lwjgl_input_Mouse.c +++ b/src/native/win32/org_lwjgl_input_Mouse.c @@ -506,6 +506,9 @@ static void UpdateMouseFields(JNIEnv *env, jobject coord_buffer_obj, jobject but } for (j = 0; j < num_buttons; j++) { buttons_buffer[j] = diMouseState.rgbButtons[j] != 0 ? JNI_TRUE : JNI_FALSE; + // track the button state in the windows message buffer state array + // to get accurate button information when releasing a grab + win32_message_button_states[j] = buttons_buffer[j]; } } else { coords[2] = accum_dwheel;