mirror of
https://github.com/glest/glest-source.git
synced 2025-09-26 15:39:21 +02:00
Added logic to NOT trigger camera mousemove if keyboard has a key pressed so you can scroll with keys and still move mouse simultaneously
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// ==============================================================
|
||||
// This file is part of Glest Shared Library (www.glest.org)
|
||||
//
|
||||
// Copyright (C) 2001-2008 Marti<EFBFBD>o Figueroa
|
||||
// Copyright (C) 2001-2008 Martio Figueroa
|
||||
//
|
||||
// You can redistribute this code and/or modify it under
|
||||
// the terms of the GNU General Public License as published
|
||||
@@ -38,6 +38,7 @@ unsigned int Window::lastMouseEvent = 0; /** for use in mouse hover calculations
|
||||
static int oldX=0,oldY=0;
|
||||
Vec2i Window::mousePos;
|
||||
MouseState Window::mouseState;
|
||||
bool Window::isKeyPressedDown = false;
|
||||
|
||||
// ===================== PUBLIC ========================
|
||||
|
||||
@@ -381,6 +382,8 @@ LRESULT CALLBACK Window::eventRouter(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
|
||||
}
|
||||
|
||||
case WM_KEYDOWN: {
|
||||
|
||||
Window::isKeyPressedDown = true;
|
||||
|
||||
eventWindow->eventKeyDown(static_cast<char>(wParam));
|
||||
break;
|
||||
@@ -398,7 +401,9 @@ LRESULT CALLBACK Window::eventRouter(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
|
||||
}
|
||||
|
||||
case WM_KEYUP: {
|
||||
|
||||
|
||||
Window::isKeyPressedDown = false;
|
||||
|
||||
eventWindow->eventKeyUp(static_cast<char>(wParam));
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user