MouseXYZSpeed() weirdness

Blitz3D Forums/Blitz3D Programming/MouseXYZSpeed() weirdness

AdsAdamJ(Posted 2006) [#1]
Try the little program below. (if you don't have a mouse wheel, change it to MouseXSpeed())

While it's running, change the window focus to another program, then go back to it. On my computer at least, both variables (foo & bar) return to 0. They shouldn't do that!



Have I missed something fundamental (it's nearly 2.30am here and I'm knackered), or is this a bug?


bytecode77(Posted 2006) [#2]
no, the same result no my machine...
seems like blitz is doing it because windows is managing the blitz window or it is a bug nobody didn't ever seen before...

i believe on the first one.
if you have any further problems on this command, just post exactly this code and the above comments into the blitz3dBug forum

cya


Stevie G(Posted 2006) [#3]
I'm pretty sure that this has already been posted on the bug forums a while back.

Stevie


Subirenihil(Posted 2006) [#4]
MouseZSpeed() is calculated by subtracting the current MouseZ() from the previous MouseZ(). Blitz is getting this directly from Windows (I think) and Windows resets MouseZ() every time you change window focus. If you watch (insert a "Text 320,270,MouseZ(),1,1"), MouseZ() returns to 0 when you switch windows. When that happens, MouseZSpeed() equals 0 - previous MouseZ() or in other words -bar. Under such circumstances, "bar = bar + foo" will ALWAYS equal set bar to 0 because foo will ALWAYS equal -bar. (basically saying: bar = bar - bar)

You might call this a Windows bug but certainly NOT a Blitz bug.


AdsAdamJ(Posted 2006) [#5]
Stevie G - Yeah, when I checked it this morning I found the thread you're thinking of.

Subirenihil - Thanks for the explanation.

It's a frustrating problem. I'm trying to make an 3D editor for a game using the WinBlitz3D DLL, and the zoom level is controlled by mouseZspeed(), so whenever you click a button it resets the zoom back to the default value. I'll come up with an alternative in this case. I thought it was the DLL to begin with, very glad it's not!