summaryrefslogtreecommitdiff
path: root/src/keyboard.c
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 /src/keyboard.c
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 'src/keyboard.c')
-rw-r--r--src/keyboard.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 4db50be855c..e8701b88708 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -5925,7 +5925,10 @@ make_lispy_event (struct input_event *event)
ASIZE (wheel_syms));
}
- if (event->modifiers & (double_modifier | triple_modifier))
+ if (NUMBERP (event->arg))
+ return list4 (head, position, make_number (double_click_count),
+ event->arg);
+ else if (event->modifiers & (double_modifier | triple_modifier))
return list3 (head, position, make_number (double_click_count));
else
return list2 (head, position);