help on query(no code)

BlitzMax Forums/BlitzMax Programming/help on query(no code)

Cruis.In(Posted 2005) [#1]
hey everyone, I'd wondering if there is anything I can do to reset the value of mousez()

id like it to reset to 0, if you STOP scrolling.

any way to do this?

maybe there needs to be a flushmouse
request? :)


Who was John Galt?(Posted 2005) [#2]
i don't think you can. You can keep track with your own variable - every time mousez increases or decreases, modify your variable by the difference. Then just read from your variable instead of mousez, and set it to zero when you want.

mymousez=mousez()

while
newmz=mousez()
mymousez=mymousez+(newmz-oldmz)
if i_want_to_reset mymousez=0
oldmz=newmz
wend


Cruis.In(Posted 2005) [#3]
yeah, ok but the problem with that is, if you overscroll, and the mouseZ goes up(whether on purpose or not), you have to scroll mouseZ all the way back through what you scrolled + more to get it to the opposite side of the field meaning from being positive to negetive. using it for zooming.


Hotcakes(Posted 2005) [#4]
No you don't. Look carefully. If you use that algorithm mymousez will equal 0 when the mousez has not changed, therefore one click back would produce -1.


Cruis.In(Posted 2005) [#5]
oh thats right... thanks :)