   Mouse Handler
  I've been making a 2D (with 3D objects) full screen game for a while and unfortunately I've come accross this little problem of not being able to track the mouse in terms of being near or far from the edge of the screen.I need to allow the mouse to get to a certain distance from the side of the monitor and then move with the mouse but not surpass the mouse or have the mouse disappear and try to find it again.  Similarly what I have in place now it constantly moves with the mouse cursor which is driving me nuts!I can track it in the OpenGL area, however that constantly changes as the screen scrolls around.  So I'm pretty sure I need to do it from the WndProc or something.. HELP!Here's an example of what I'm working on://#includes...float ax, ay; // start mouse+click positionfloat bx, by; // end mouse+drag positionbool  LMouseButton=false;  // Left Mouse Button// ...int InitGL(GLvoid) // Initialization function for setup{//...}void GetMouseInfo(){ static POINT lastMouse = {0,0}; GetCursorPos(&lastMouse);    //Get current mouse position SetCursorPos(320,240);  //Set cursor position for later calculation float moveX = float((320 - lastMouse.x))/100.0f; //Calculate movement of the mouse with the above coords float moveY = float((240 - lastMouse.y))/100.0f; mousePosition[0] -= moveX; //Update mouse position mousePosition[1] += moveY; screen_x = -mousePosition[0]; // !!!!! THIS IS CURRENTLY WHAT MOVES THE SCREEN screen_y = -mousePosition[1]; // !!!!! THIS IS CURRENTLY WHAT MOVES THE SCREEN  if (LMouseButton == false)  {   ax = mousePosition[0];   ay = mousePosition[1];  } if (LMouseButton == true)  {   bx = mousePosition[0];   by = mousePosition[1];   glColor3f(0.3f, 1.0f, 0.3f);   glBegin(GL_LINES);    glVertex2f(ax, ay);  //this took alot of my brain    glVertex2f(bx, ay);    glVertex2f(bx, ay);    glVertex2f(bx, by);glVertex2f(bx, by);    glVertex2f(ax, by);    glVertex2f(ax, by);    glVertex2f(ax, ay);   glEnd();  }}void DrawMouseCursor(){ glDisable(GL_DEPTH_TEST); glBegin(GL_TRIANGLES);  glColor3f(1.0f,0.3f,0.3f);  glVertex2f(mousePosition[0],mousePosition[1]);  glVertex2f(mousePosition[0],mousePosition[1]-0.5f);  glVertex2f(mousePosition[0]+0.5f,mousePosition[1]); glEnd(); glEnable(GL_DEPTH_TEST);}int DrawGLScene(GLvoid) // Draw Everything{ stdrot(); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); glColorMask(1,1,1,1); glLightfv(GL_LIGHT0, GL_POSITION, LightPos); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Blending Based On Source Alpha And 1 Minus Dest Alpha glDisable(GL_LIGHTING); //... glTranslatef(screen_x, screen_y, screen_z);// Zoom And Raise Camera glPushMatrix(); glDisable(GL_LIGHTING); glDisable(GL_DEPTH_TEST); GetMouseInfo(); DrawMouseCursor(); glFlush();// Flush The GL Pipeline return TRUE;// Everything Went OK}//...Any suggestions would be appreciated.   
  If I'm reading you right:Get mouse positionIf Mouse X < Edge Size  Pan LeftElse If Mouse X > (Screen Width - Edge Size)  Pan RightIf Mouse Y < Edge Size  Pan UpElse If Mouse Y > (Screen Height - Edge Size)  Pan Down