Note: I'm using openlayer for my program.
I want my program to scroll when the rightmouse button is pressed.
I want a unlimited movementrange for that.
I'm using this code:
int mouseXMovement, mouseYMovement; get_mouse_mickeys( &mouseXMovement, &mouseYMovement ); if( mouse_b == 2 ) { worldX += mouseXMovement; worldY += mouseYMovement; }
But when the mouse cursor reaches the DESKTOP Borders the mouse stops moving and the mickeys will stay at zero.
(This has nothing to do with the borders of my program. Just the windows desktop border)
Is there an option to disable the desktop mousecursor as long as my program is active?
This happens WINDOWED and FULLSCREEN.
[EDIT] Sorry. Happens only in WINDOWED mode[/EDIT]
I can't remember, but i think this method worked with plain allegro.
But with openlayer I get this desktop border problem.
How do I achieve unlimited mouse range?
int mouseXMovement, mouseYMovement; get_mouse_mickeys( &mouseXMovement, &mouseYMovement ); position_mouse(SCREEN_W/2, SCREEN_H/2); if( mouse_b == 2 ) { worldX += mouseXMovement; worldY += mouseYMovement; }
Easy and effective!
Thank you!
Just be careful if you want to Alt-tab away because if your program isn't paused your mouse will not be properly movable.
Hmm.. true.
Just changed the code to this:
if( mouse_b == 2 ) { int mouseXMovement, mouseYMovement; get_mouse_mickeys( &mouseXMovement, &mouseYMovement ); position_mouse(SCREEN_W/2, SCREEN_H/2); worldX += mouseXMovement; worldY += mouseYMovement; }
So the code still works and the alt-tab problem is solved.
Thank you for noting that!