Mouse Scroll Wheel Event

Description

In BBj 6.0 and higher, the mouse scroll wheel was moved.

Remarks

ON_ MOUSE_SCROLL fires when the mouse scroll wheel moves.

The event is always dispatched on the window over which the mouse wheel moved.

Mandatory/Optional

Optional

Event Mask Bit

$00000020$

Event Template

context:u(2),code:c(1),id:u(2),flags:u(1),x:u(2),y:u(2)

Field

Description

context

Context of the window over which the mouse wheel was moved.

code

W

id

Control ID of the control (or 0 if window) over which the mouse wheel was moved.

flags

Key pressed:

$01$ = Shift

$02$ = Ctrl

$10$ = Alt

Direction:

$10$ = Up

$00$ = Down

$20$ = Reserved

$40$ = Reserved

x

Context of the focused window, 65535 if focus in another application.

y

Control ID of the focused control, 65535 if focus in another application.

Example

SYSGUI=UNT; OPEN(SYSGUI)"X0"
sysgui! = BBjAPI().getSysGui()
win! = sysgui!.addWindow(10,10,160,160,"Scroll Wheel Test",$0000000B$)
win!.setCallback(win!.ON_CLOSE,"APP_CLOSE")
win!.setCallback(win!.ON_MOUSE_SCROLL,"MOUSE_SCROLLED")
button! = win!.addButton(101,10,10,80,30,"$$",$$)
process_events

APP_CLOSE:
release
return

MOUSE_SCROLLED:
    dim event$:tmpl(sysgui)
    event$ = BBjAPI().getSysGui().getLastEvent().getEventString()
    print event.code$,event.context, event.id,event.flags,event.x,event.y
return