Mouse Speed Functions Additions

BlitzMax Forums/BlitzMax Module Tweaks/Mouse Speed Functions Additions

Ked(Posted 2009) [#1]
Hey! After reading in the code archives that people were having trouble getting MouseXSpeed(), MouseYSpeed(), and MouseZSpeed() to work like the Blitz3D functions, I went into the BlitzMax source to see if I could help. I modified BRL.System and BRL.PolledInput and got everything working like it should. (I tested them with a MiniB3D example.)

BRL.System


BRL.PolledInput


Since this is a private forum, I hope I'm allowed to post the source to these modules! Hopefully, these modifications can be added to SVN?


Brucey(Posted 2009) [#2]
Does it provide the same results on all platforms?


Ked(Posted 2009) [#3]
I only have a Windows computer, but it should. I didn't add any platform specific code.


markcw(Posted 2009) [#4]
Can I have some test code for Linux then, coz I'm lazy.


Yan(Posted 2009) [#5]
Hmmm...I obviously didn't give enough detail in the other thread, so I fixed the incorrect Z axis handling...






Ked(Posted 2009) [#6]
Can I have some test code for Linux then, coz I'm lazy.

Sure.


Here's the MiniB3D example I used:



markcw(Posted 2009) [#7]
Tested in window/fullscreen on ubuntu hardy, also tested Yan's version. Both work fine.

Fixed the incorrect Z axis handling...

I'm not sure those two additions are necessary since mouse z state resets itself.


Yan(Posted 2009) [#8]
I'm afraid, you're mistaken. ;op

Try this with the original version...

...Play around with the zoom and then press 'M'...Oops... ;o)

The same thing will happen when focus is lost too.


Hence the *necessary* modifications. :o)

[edit]
You may have to increase the scale multiplier to see the effect clearly as I haven't actually tried either version, TBH.
[/edit]


markcw(Posted 2009) [#9]
Ok, thanks. I see what you mean.


Ked(Posted 2009) [#10]
Can someone with a Mac test this?


Ked(Posted 2009) [#11]
It would be very helpful if someone with a Mac could test this. I really would like for this to be included in the next update.


markcw(Posted 2009) [#12]
Hi Ked, works as expected on my panther g3 ppc laptop.

I only tested mousex and y because of the trackpad though. I'll try to get a usb mouse to test mouse z. I used Yan's tweaked code and your basic test code as I don't have minib3d installed.

Also, could you wrap your code in codebox tags? Would be nice.


Ked(Posted 2009) [#13]
Thanks, markcw! Let me know what you get with the usb mouse.

Updated top.


markcw(Posted 2009) [#14]
Ok, I got a usb mouse this morning and mouse z also works fine in your basic test code.

Cheers for the edit.


Ked(Posted 2009) [#15]
Awesome!

I have a question, though: What kind of results were you getting? Mark wanted to make sure it worked on Mac because:
Mac ... seems to sample mouse at more frequent intervals...



markcw(Posted 2009) [#16]
Well I'm not sure what you mean. The basic test code really only prints negative or positive values and then returns to zero, as for the values I didn't notice anything unusual.


Ked(Posted 2009) [#17]
Well I'm not sure what you mean. The basic test code really only prints negative or positive values and then returns to zero, as for the values I didn't notice anything unusual.

I meant if you were getting any doubled return values or something like that.

Anyway, thanks again for your help! Emailing Mark now...