summaryrefslogtreecommitdiff
path: root/lisp/subr.el
diff options
context:
space:
mode:
authorAlan Third <alan@idiocy.org>2017-09-08 19:26:47 +0100
committerAlan Third <alan@idiocy.org>2017-09-19 20:08:51 +0100
commita5fec62b519ae8c0a6528366ac8b71cd0c7ac52e (patch)
treef9b300285aacb4df9995ea5e4559663f2afee735 /lisp/subr.el
parent7b3d1c6beb54ef6c423a93df88aebfd6fecbe2c2 (diff)
downloademacs-a5fec62b519ae8c0a6528366ac8b71cd0c7ac52e.tar.gz
Provide native touchpad scrolling on macOS
* etc/NEWS: Describe changes. * lisp/term/ns-win.el (mouse-wheel-scroll-amount, mouse-wheel-progressive-speed): Set to smarter values for macOS touchpads. * src/nsterm.m (emacsView::mouseDown): Use precise scrolling deltas to calculate scrolling for touchpads and mouse wheels. (syms_of_nsterm): Add variables 'ns-use-system-mwheel-acceleration', 'ns-touchpad-scroll-line-height' and 'ns-touchpad-use-momentum'. * src/keyboard.c (make_lispy_event): Pass on .arg when relevant. * src/termhooks.h (event_kind): Update comments re. WHEEL_EVENT. * lisp/mwheel.el (mwheel-scroll): Use line count. * lisp/subr.el (event-line-count): New function.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r--lisp/subr.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index 96b1ac19b4b..cf15ec287ff 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1270,6 +1270,11 @@ See `event-start' for a description of the value returned."
"Return the multi-click count of EVENT, a click or drag event.
The return value is a positive integer."
(if (and (consp event) (integerp (nth 2 event))) (nth 2 event) 1))
+
+(defsubst event-line-count (event)
+ "Return the line count of EVENT, a mousewheel event.
+The return value is a positive integer."
+ (if (and (consp event) (integerp (nth 3 event))) (nth 3 event) 1))
;;;; Extracting fields of the positions in an event.