|
get_mouse_mickeys() alternative for windowed modes |
Paul whoknows
Member #5,081
September 2004
|
I am using get_mouse_mickeys() a lot in my game, and it works fine in non-windowed modes, but as the documentation says TFM said: 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? ____ "The unlimited potential has been replaced by the concrete reality of what I programmed today." - Jordan Mechner. |
CGamesPlay
Member #2,559
July 2002
|
I just use:position_mouse(SCREEN_W / 2, SCREEN_H / 2) -- Ryan Patterson - <http://cgamesplay.com/> |
Paul whoknows
Member #5,081
September 2004
|
It seems that I was not clear enough. Quote: 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. ____ "The unlimited potential has been replaced by the concrete reality of what I programmed today." - Jordan Mechner. |
Thomas Fjellstrom
Member #476
June 2000
|
get_mouse_mickeys will still function if you keep repositioning the mouse in the center. -- |
CGamesPlay
Member #2,559
July 2002
|
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. -- Ryan Patterson - <http://cgamesplay.com/> |
ImLeftFooted
Member #3,935
October 2003
|
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. |
Paul whoknows
Member #5,081
September 2004
|
I am slow:P, but now I got it! EDIT Quote: And also most OSs have 'lock the mouse to my window' API calls Which Windows specific functions should I use to do that? ____ "The unlimited potential has been replaced by the concrete reality of what I programmed today." - Jordan Mechner. |
Evert
Member #794
November 2000
|
Quote: How can I replace this function for windowed modes? You can't, in a portable way. |
Paul whoknows
Member #5,081
September 2004
|
Quote: 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? ____ "The unlimited potential has been replaced by the concrete reality of what I programmed today." - Jordan Mechner. |
CGamesPlay
Member #2,559
July 2002
|
Quote: Which Windows specific functions should I use to do that? Well, position_mouse works fine, and it works in Linux, too. -- Ryan Patterson - <http://cgamesplay.com/> |
Richard Phipps
Member #1,632
November 2001
|
Yes, position_mouse works well. |
|