|
Mouse wheel in allegro |
CursedTyrant
Member #7,080
April 2006
|
Is there a way (or rather, a specific function), that would let me use the mouse wheel in my program (And detect if it's been "scrolled")? I'm coding a scrollable list of elements, and it would be nice if I could scroll it using said wheel. --------- |
Thomas Fjellstrom
Member #476
June 2000
|
mouse_z is your friend. -- |
SonShadowCat
Member #1,548
September 2001
|
Check out mouse_z, I believe that deals with the wheel. http://allegro.cc/manual/api/mouse-routines/ Edit: 2 seconds late! |
HoHo
Member #4,534
April 2004
|
There is a variable called mouse_z thats value changes when wheel is scrolled. [edit] __________ |
CursedTyrant
Member #7,080
April 2006
|
Oh well, it would be much more readable if it would be called mouse_wheel, but I guess it'll have to do. One other thing, is there something like get_mouse_mickeys() which returns the wheel movement, or do I have to code it myself (I'm lazy, I know )? --------- |
ixilom
Member #7,167
April 2006
|
Maybe something like this void get_mouse_mickeys_ex(int *mickeyx, int *mickeyy, int *mickeyz) { get_mouse_mickeys(mickeyx,mickeyy); static int mz = mouse_z; if(mouse_z != mz) *mickeyz = mouse_z - mz; else *mickeyz = 0; mz = mouse_z; } Havent tested it, probably not thinking straight either because I just woke up, use it at your own risk ___________________________________________ |
|