: mouse-scroll ( wParam -- array )
>lo-hi [ -80 /f ] map ;
+: mouse-horizontal-scroll ( wParam -- direction )
+ hi-word 80 /f 0 2array ;
+
: mouse-event>gesture ( uMsg -- button )
key-modifiers swap message>button
[ <button-down> ] [ <button-up> ] if ;
TrackMouseEvent win32-error=0/f
>lo-hi swap window move-hand fire-motion ;
+: (handle-mousewheel) ( direction hWnd -- )
+ hand-loc get-global swap window send-scroll ; inline
+
:: handle-wm-mousewheel ( hWnd uMsg wParam lParam -- )
- wParam mouse-scroll hand-loc get-global hWnd window send-scroll ;
+ wParam mouse-scroll hWnd (handle-mousewheel) ;
+
+:: handle-wm-mousehwheel ( hWnd uMsg wParam lParam -- )
+ wParam mouse-horizontal-scroll hWnd (handle-mousewheel) ;
: handle-wm-cancelmode ( hWnd uMsg wParam lParam -- )
! message sent if windows needs application to stop dragging
${ WM_MOUSEMOVE [ handle-wm-mousemove 0 ] }
${ WM_MOUSEWHEEL [ handle-wm-mousewheel 0 ] }
+ ${ WM_MOUSEHWHEEL [ handle-wm-mousehwheel 0 ] }
${ WM_CANCELMODE [ handle-wm-cancelmode 0 ] }
${ WM_MOUSELEAVE [ handle-wm-mouseleave 0 ] }
} expand-keys-set-at
CONSTANT: WM_XBUTTONDBLCLK 0x020D
CONSTANT: WM_MOUSELAST_5 0x020D
CONSTANT: WM_MOUSELAST_4 0x020A
+CONSTANT: WM_MOUSEHWHEEL 0x020E
CONSTANT: WM_MOUSELAST_PRE_4 0x0209
CONSTANT: WM_PARENTNOTIFY 0x0210
CONSTANT: WM_ENTERMENULOOP 0x0211