Using WM_MOUSEWHEEL?

What is the best way to get WM_MOUSEWHEEL working for just plain up and down rolling? The idea is to have my OpenGL program use a camera system for zooming in and out; at the moment just forwards and backwards. The mouse wheel detects upwards rolling of the wheel but not downwards with this code. It was no problem getting the camera to move as planned with the cursor keys using WM_KEYDOWN. Here are the appropriate examples of code. Is there something I am missing?

1
2
3
4
5
6
7
8
9
10
11
12
13
case WM_MOUSEWHEEL:
 			if ((short )GET_WHEEL_DELTA_WPARAM(wParam) > 0)
			{
				g_Camera.MoveCamera(0.05f);		
				CreateScene();
			}
			break;
			if ((short)GET_WHEEL_DELTA_WPARAM(wParam) < 0)		
			{
				g_Camera.MoveCamera(-0.05f);		
				CreateScene();
			}
			break;


1
2
3
4
5
6
7
8
9
10
11
12
13
case WM_KEYDOWN:
			keys[wParam]=true;
                        if(keys[VK_UP])
			{
				g_Camera.MoveCamera(0.05f);		
				CreateScene();							
			}
                        if(keys[VK_DOWN])
			{
				g_Camera.MoveCamera(-0.05f);		
				CreateScene();							
			}
			


Topic archived. No new replies allowed.