- Online Community Forums » Programming Questions » set_mouse_speed

This thread is locked; no one can reply to it. rss feed Print
Member #6,152
August 2005

There's plenty of topics out on the forums that I've glanced at about the above function. Here's what I've got happens so far when using the set_mouse_speed function in the following settings (I'd appreciate anyone who could fill in the '?'s):

Windows - Windowed Mode: No affect
Windows - Fullscreen Mode: Works (passing larger values to the function makes mouse move slower)
Linux - Windowed Mode: ??
Linux - Fullscreen Mode: ??
Mac - Windowed Mode: ??
Mac - Fullscreen Mode: ??

I guess I'm just going to forget about set_mouse_speed and write my own function to change how fast the mouse moves. I can't seem to get this to work with the hardware cursor, so I'm just drawing my own mouse sprite, which means it could lag on slower computers. Here's the basic code of what I'm doing to change how fast the mouse is moving, in case I'm doing something evil:

1//In a logic function
2int x, y;
4get_mouse_mickeys(&x, &y);
5if(x != 0 || y != 0)
7 //gmx, gmy are global float variables storing the position
8 //of the adjusted mouse position
9 //ACC is the adjustment factor
10 gmx += x * ACC;
11 gmy += y * ACC;
13 position_mouse(gmx, gmy);
17//In the final portion of the drawing function
18draw_sprite(buffer, mouse_sprite, gmx, gmy);
19blit(buffer, screen, 0, 0, 0, 0, screen->w, screen->h);

------------ | My Tech Blog: The Digital Helm

Milan Mimica
Member #3,877
September 2003

For linux (X11), set_mouse_speed() is implemented in 4.2.2 (SVN). Does nothing in 4.2.1 I think.

Go to: