mouse.on_move

Ask all of your support questions here

mouse.on_move

Postby Ivan » Wed Jan 19, 2011 4:39 pm

I noticed several things.
1.It appears that moving the cursor with 'mouse:set_cursor_pos' leads to calling the 'mouse:on_move' event. Not sure if this is a good idea. Probably not.
2.'mouse:on_move' doesn't register changes in cursor position when the cursor reaches the edge of the screen. Now this seems like an expected behavior however it could lead to problems if you try implementing your own cursor or when using 'mouse:hide_cursor'. I think the best solution would be to go into 'exclusive' mode or whatever when the user calls 'hide_cursor" so that the hidden cursor cannot leave the game window.
Ivan
Site Admin
 
Posts: 414
Joined: Thu Dec 27, 2007 9:21 pm

Re: mouse.on_move

Postby Phil » Wed Feb 09, 2011 1:24 am

1. I'm not sure how to make it not report, on_move comes from DirectInput.
2. For now I'll export set_mode(bool exclusive, bool foreground) for input devices for better control from lua.
Phil
 
Posts: 200
Joined: Fri Dec 28, 2007 12:47 am

Re: mouse.on_move

Postby Ivan » Fri Oct 28, 2011 8:40 am

Another bug: set_cursor_pos sets the cursor position without taking into account the title and window decorations.
For example:

Code: Select all
  mouse:set_cursor_pos ( 0, 0 )
  assert ( mouse.xaxis == 0 and mouse.yaxis == 0 ) -- assert fails


Also, it looks like set_cursor_pos doesn't work properly after the window has been repositioned manually. What happens is that after calling "set_cursor_pos" the cursor is moved to a point outside of the game window.
Ivan
Site Admin
 
Posts: 414
Joined: Thu Dec 27, 2007 9:21 pm


Return to Support

Who is online

Users browsing this forum: No registered users and 0 guests

cron