From c2ffe7e53528482d8f051134fdf046df12d6f4bf Mon Sep 17 00:00:00 2001 From: Alexander Ilin Date: Sun, 25 Feb 2024 17:41:47 +0100 Subject: [PATCH] ui.backend.windows: scroll 10 times faster with Shift --- basis/ui/backend/windows/windows.factor | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/basis/ui/backend/windows/windows.factor b/basis/ui/backend/windows/windows.factor index f2a37f58d3..4057e9899a 100644 --- a/basis/ui/backend/windows/windows.factor +++ b/basis/ui/backend/windows/windows.factor @@ -436,11 +436,14 @@ SYMBOL: nc-buttons message>button nc-buttons get swap [ push ] [ remove! drop ] if ; +: scroll-distance ( wParam -- n ) + [ hi-word 80 /f ] [ lo-word ] bi MK_SHIFT mask? [ 10 * ] when ; + : mouse-scroll ( wParam -- direction ) - hi-word -80 /f 0 swap 2array ; + scroll-distance neg 0 swap 2array ; : mouse-horizontal-scroll ( wParam -- direction ) - hi-word 80 /f 0 2array ; + scroll-distance 0 2array ; : mouse-event>gesture ( uMsg -- button ) key-modifiers swap message>button -- 2.34.1