I am using get_mouse_mickeys() a lot in my game, and it works fine in non-windowed modes, but as the documentation says
Note that the infinite movement may not work in windowed mode, since under some platforms the mouse would leave the window, and may not work at all if the hardware cursor is in use.
How can I replace this function for windowed modes?
I want my game running in both: fullscreen and windowed modes!
I just use:position_mouse(SCREEN_W / 2, SCREEN_H / 2)
It seems that I was not clear enough.
As we all already know, get_mouse_mickeys() measures how far the mouse has moved since the last call to this function, that's exactly what I need to achieve without using this function(because it doesn't work in windowed modes)
position_mouse(SCREEN_W / 2, SCREEN_H / 2)
You are positioning the mouse at the center of the screen, that's not what I want.
get_mouse_mickeys will still function if you keep repositioning the mouse in the center.
If you position the mouse in the center of the screen, get_mouse_mickeys will work, because the user cannot move the mouse outside of the screen.
Except on OSX. Or has position_mouse been fixed for that yet?
I actually use delta mouse movement (ie storing the old position and comparing the difference). But I also want the mouse to be able to leave via the bottom in windowed mode. So mickies dont work.
And also most OSs have 'lock the mouse to my window' API calls, allegro should really make that available.
I am slow:P, but now I got it!
However I think that will raise another problems, (I am also using mouse_x, and mouse_y), I'll try it now!
Thanks!
EDIT
And also most OSs have 'lock the mouse to my window' API calls
Which Windows specific functions should I use to do that?
How can I replace this function for windowed modes?
You can't, in a portable way.
And also most OSs have 'lock the mouse to my window' API calls, allegro should really make that available.
Which Windows specific functions should I use to do that?
Which Windows specific functions should I use to do that?
Well, position_mouse works fine, and it works in Linux, too.
Yes, position_mouse works well.