Browse Source

Removed simulated mouse inputs and "mouseUp" hack after window move/resize since it shouldn't really be needed after the input refactor in last revision

Marko Pintera 12 years ago
parent
commit
4f9f37f88d

+ 0 - 11
CamelotCore/Include/CmInput.h

@@ -47,21 +47,10 @@ namespace CamelotFramework
 		bool isButtonDown(ButtonCode keyCode) const;
 		bool isButtonDown(ButtonCode keyCode) const;
 
 
 		Int2 getCursorPosition() const { return mMouseAbsPos; }
 		Int2 getCursorPosition() const { return mMouseAbsPos; }
-
-		// Thread safe. Will only be processed on next "update".
-		void simulateButtonDown(ButtonCode code);
-
-		// Thread safe. Will only be processed on next "update".
-		void simulateButtonUp(ButtonCode code);
-
 	private:
 	private:
 		std::shared_ptr<RawInputHandler> mRawInputHandler;
 		std::shared_ptr<RawInputHandler> mRawInputHandler;
 		std::shared_ptr<OSInputHandler> mOSInputHandler;
 		std::shared_ptr<OSInputHandler> mOSInputHandler;
 
 
-		CM_MUTEX(mSimulatedInputMutex);
-		Vector<ButtonCode>::type mSimulatedButtonUp;
-		Vector<ButtonCode>::type mSimulatedButtonDown;
-
 		float mSmoothHorizontalAxis;
 		float mSmoothHorizontalAxis;
 		float mSmoothVerticalAxis;
 		float mSmoothVerticalAxis;
 
 

+ 0 - 2
CamelotCore/Include/CmPlatformWndProc.h

@@ -11,8 +11,6 @@ namespace CamelotFramework
 		static LRESULT CALLBACK _win32WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
 		static LRESULT CALLBACK _win32WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
 
 
 	private:
 	private:
-		static UINT32 mMoveResizeMouseUpState; // 0 - Didn't receive and not waiting for mouse up, 1 - Awaiting mouse up, 2 - Received mouse up
-
 		static LRESULT translateNonClientAreaType(NonClientAreaBorderType type);
 		static LRESULT translateNonClientAreaType(NonClientAreaBorderType type);
 
 
 		static void getMouseData(HWND hWnd, WPARAM wParam, LPARAM lParam, Int2& mousePos, OSPositionalInputButtonStates& btnStates);
 		static void getMouseData(HWND hWnd, WPARAM wParam, LPARAM lParam, Int2& mousePos, OSPositionalInputButtonStates& btnStates);

+ 0 - 33
CamelotCore/Source/CmInput.cpp

@@ -80,25 +80,6 @@ namespace CamelotFramework
 		else
 		else
 			mOSInputHandler->update();
 			mOSInputHandler->update();
 
 
-		Vector<ButtonCode>::type simulatedUp;
-		Vector<ButtonCode>::type simulatedDown;
-
-		{
-			CM_LOCK_MUTEX(mSimulatedInputMutex);
-
-			simulatedUp = mSimulatedButtonUp;
-			simulatedDown = mSimulatedButtonDown;
-
-			mSimulatedButtonUp.clear();
-			mSimulatedButtonDown.clear();
-		}
-
-		for(auto& buttonCode : simulatedDown)
-			buttonDown(buttonCode);
-
-		for(auto& buttonCode : simulatedUp)
-			buttonUp(buttonCode);
-
 		updateSmoothInput();
 		updateSmoothInput();
 	}
 	}
 
 
@@ -195,20 +176,6 @@ namespace CamelotFramework
 		return mKeyState[button & 0x0000FFFF];
 		return mKeyState[button & 0x0000FFFF];
 	}
 	}
 
 
-	void Input::simulateButtonDown(ButtonCode code)
-	{
-		CM_LOCK_MUTEX(mSimulatedInputMutex);
-
-		mSimulatedButtonDown.push_back(code);
-	}
-
-	void Input::simulateButtonUp(ButtonCode code)
-	{
-		CM_LOCK_MUTEX(mSimulatedInputMutex);
-
-		mSimulatedButtonUp.push_back(code);
-	}
-
 	void Input::updateSmoothInput()
 	void Input::updateSmoothInput()
 	{
 	{
 		float currentTime = gTime().getTime();
 		float currentTime = gTime().getTime();

+ 0 - 18
CamelotCore/Source/CmPlatformWndProc.cpp

@@ -67,16 +67,6 @@ namespace CamelotFramework
 			if (wParam != VK_SPACE)
 			if (wParam != VK_SPACE)
 				return 0;
 				return 0;
 			break;
 			break;
-		case WM_ENTERSIZEMOVE:
-			mMoveResizeMouseUpState = 1;
-			break;
-		case WM_EXITSIZEMOVE:
-			// HACK - Windows doesn't send mouseUp event after move/resize if the cursor moved out of the original window bounds
-			if(mMoveResizeMouseUpState != 2)
-				gInput().instance().simulateButtonUp(BC_MOUSE_LEFT);
-
-			mMoveResizeMouseUpState = 0;
-			break;
 		case WM_MOVE:
 		case WM_MOVE:
 			windowMovedOrResized(win);
 			windowMovedOrResized(win);
 			break;
 			break;
@@ -177,15 +167,7 @@ namespace CamelotFramework
 				mMouseLeftWindows.push_back(win);
 				mMouseLeftWindows.push_back(win);
 			}
 			}
 			break;
 			break;
-		case WM_NCLBUTTONUP:
 		case WM_LBUTTONUP:
 		case WM_LBUTTONUP:
-			// Part of a hack that's done in WM_EXITSIZEMOVE (see there)
-			if(mMoveResizeMouseUpState = 1)
-				mMoveResizeMouseUpState = 2;
-
-			if(uMsg == WM_NCLBUTTONUP)
-				break;
-
 			{
 			{
 				Int2 intMousePos;
 				Int2 intMousePos;
 				OSPositionalInputButtonStates btnStates;
 				OSPositionalInputButtonStates btnStates;