Re: [pygame] Mouse Speed

2007-05-03 Thread Rodney Brown
I just finished implementing this.  It does have the desired effect initially.  
However, once you've reached the edge of the window with the mouse, it stops 
feeding relative movement values.  Even when the mouse is set to invisible, 
which is supposed to turn on the virtual mouse thing, it still stops once 
you've reached the edge of the window.  I've tried it both with a windowed 
screen and a full screen.

Maybe it matters where in the code you turn off the mouse?  Right now, it's one 
of the las thing I do in initialization, should I turn it off before setting 
the display mode?

- Original Message 
From: Luke Paireepinart [EMAIL PROTECTED]
To: pygame-users@seul.org
Sent: Tuesday, May 1, 2007 5:49:02 PM
Subject: Re: [pygame] Mouse Speed

As for the jumping of the mouse:
I don't see why the get_rel() would cause problems.
The docs say that the mouse will enter a virtual input mode, wherein 
relative mouse motion events won't be constrained to the edges of the 
screen,
so it sounds like this is a perfect solution.
Except, I'd use a multiplier instead of a divisor.






__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: [pygame] Mouse Speed

2007-05-03 Thread Patrick Mullen

You could try mouse.set_pos, reading the relative movements and then set it
to the center of the screen.  Of course this is extremely annoying for the
user in windows mode, but you would probably only do this in fullscreen
anyway.


Re: [pygame] Mouse Speed

2007-05-01 Thread Charles Joseph Christie II
On Tuesday 01 May 2007 03:01:43 pm Rodney Brown wrote:
 The more I read up on this, it seems what I should do is hide the real
 mouse cursor and use a sprite instead.  Then I could maybe take the value
 from pygame.mouse.get_rel() and cut the x/y values in half to slow down
 movement of the sprite cursor?

 - Original Message 
 From: Rodney Brown [EMAIL PROTECTED]
 To: pygame-users pygame-users@seul.org
 Sent: Saturday, April 28, 2007 11:21:36 AM
 Subject: [pygame] Mouse Speed

 Hello,

 I am trying to figure out how to slow down the mouse pointer in pygame. 
 I've looked over both the mouse and cursor documentation and don't see a
 speed setting.

 I wrote a very simple app for someone.  It's not a game, but uses the mouse
 and draw functions of pygame.  I use Linux and the user I've written the
 app for is on Windows.  I recommended they slow down the pointer in the
 Windows crontrol panel.  This works for Windows but the mouse runs at full
 speed in my app, then goes back down to the slower speed he's set in
 Windows once he exits the app.

 So is there any way to slow down the mouse in pygame?  A couple people on
 the irc channel suggested slowing down my game engine, but I don't have
 much of an engine and that wouldn'ts affect the mouse pointer anyways.

 Any suggestions?







   Ahhh...imagining that irresistible new car smell?
  Check out
 new cars at Yahoo! Autos.





 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around
 http://mail.yahoo.com

Wouldn't that cause sporadic jumping of the mouse?


Re: [pygame] Mouse Speed

2007-05-01 Thread Luke Paireepinart

Charles Joseph Christie II wrote:

On Tuesday 01 May 2007 03:01:43 pm Rodney Brown wrote:
  

The more I read up on this, it seems what I should do is hide the real
mouse cursor and use a sprite instead.  Then I could maybe take the value
from pygame.mouse.get_rel() and cut the x/y values in half to slow down
movement of the sprite cursor?

[snip lots of stuff]



Wouldn't that cause sporadic jumping of the mouse?
  
Charles, when you reply to someone, can you try to remove as much of the 
irrelevant reply-stuff as possible?

It makes it hard to read through e-mails quickly otherwise.

As for the jumping of the mouse:
I don't see why the get_rel() would cause problems.
The docs say that the mouse will enter a virtual input mode, wherein 
relative mouse motion events won't be constrained to the edges of the 
screen,

so it sounds like this is a perfect solution.
Except, I'd use a multiplier instead of a divisor.
That way, later, you can have a configuration option slider
that goes from, for example, 0.5 to 1.5, and you multiply this value by 
all your relative mouse movements.
The only reason I suggest not using a divisor is because it's less clear 
what you mean if you have to describe the functionality to the user.
if you set the slider on 1, the movements will be normal.  on 2, they 
will be halved. etc.


Also, I'm not sure how get_rel() is reported, but I'd suggest 
maintaining the mouse cursor x and y values as floats, not integers.
Only because if you're callign get_rel() at a rate that results in only 
1 or 0 change in the x-y values, and you multiply it by something less 
than 1,

and cast it as an integer, all your movement will be floored to 0.

HTH,
-Luke