limit mouse buttons to 5, since we can't read more at this time

This commit is contained in:
Brian Matzon 2012-01-29 20:35:22 +00:00
parent 639d1d1457
commit 97c6cb1daf
1 changed files with 1 additions and 1 deletions

View File

@ -65,7 +65,7 @@ final class WindowsMouse {
WindowsMouse(long hwnd) throws LWJGLException {
this.hwnd = hwnd;
this.mouse_button_count = WindowsDisplay.getSystemMetrics(WindowsDisplay.SM_CMOUSEBUTTONS);
this.mouse_button_count = Math.min(5, WindowsDisplay.getSystemMetrics(WindowsDisplay.SM_CMOUSEBUTTONS));
this.has_wheel = WindowsDisplay.getSystemMetrics(WindowsDisplay.SM_MOUSEWHEELPRESENT) != 0;
this.blank_cursor = createBlankCursor();
this.button_states = new byte[mouse_button_count];