IUP_MOTION_CB

IUP - Portable User Interface

WHEEL_CB

Action generated when the mouse wheel is rotated. If this callback is not defined the wheel will automatically scroll the canvas in the vertical direction by some lines, the SCROLL_CB callback if defined will be called with the IUP_SBDRAGV operation.

Callback

int function(Ihandle *self, float delta, int x, int y, char *r); [in C]
elem:wheel(delta, x, y: number, r: string) -> (ret: number) [in IupLua3]
elem:wheel_cb(delta, x, y: number, r: string) -> (ret: number) [in IupLua5]

self: identifier of the canvas that activated the function's execution.
delta: the amount the wheel was rotated in notches.
x, y: position in the canvas where the event has occurred, in pixels.
r: status of mouse buttons and certain keyboard keys at the moment the event was generated. The following macros must be used for verification:

isshift(r)
iscontrol(r)
isbutton1(r)
isbutton2(r)
isbutton3(r)
isdouble(r)

Notes

In Motif delta is always 1or -1. In Windows is some situations delta can reach the value of two. In the future with more precise wheels this increment can be changed.

The wheel will only work if the focus is at the canvas.

Affects

IupCanvas