Where is the mouse wheel mapping?

Posted By: Ericmor

Where is the mouse wheel mapping? - 06/04/11 11:41

Hi folks,
i´m rebuilding my starting camera code, but cannot find the key function calls for the mouse wheel nowhere in the manual!
Those are the key mappings for mouse i found:
Mouse left: on_mouse_left, mouse_left
Mouse middle: on_mouse_middle, mouse_middle
Mouse right: on_mouse_right, mouse_right
There´s a 'mickey.z' mentioned, but doesn´t seen to work... is the way i´m accessing the variable, peraphs?
Code:
...
  if(mickey.z>0){follow_cam_distance+=10*time_step;beep();}
  if(mickey.z<0){follow_cam_distance-=10*time_step;beep();}
...


If there´s any other way of accessing mouse wheel functions, i´d appreciate any help. Thanks in advance.
Posted By: Lukas

Re: Where is the mouse wheel mapping? - 06/08/11 14:32

mickey.z should be the number of notches you moved your mouse wheel in the last frame times 120.

This is how it should work:
follow_cam_distance+=some_factor*mickey.z;

And don't multiplicate it with time_step, because as it already measures the notches PER FRAME, it's already framerate independent. Multiplicating it with time_step only makes it framerate dependent again.
Posted By: MrGuest

Re: Where is the mouse wheel mapping? - 06/08/11 14:34

mickey
Posted By: Joey

Re: Where is the mouse wheel mapping? - 06/08/11 14:47

maybe you're not calling it in a while loop
© 2024 lite-C Forums