>>>> "Ren" == Ren <Ren> writes:
Ren> The below patch generates button{4,5}up events when the
Ren> scrollbars are not showing¹, so you can use the mwheel
Ren> package Norbert mentioned:
Ren> It works for me, but I'm not familiar with win32 programming
Ren> (or XEmacs internals), so try at your own risk. Thanks for
Ren> prodding me to look into this btw, it's been annoying me a
Ren> while.
Thanks for the patch. Would you mind resending to xemacs-patches,
with a ChangeLog? That's the best way to bring it to the attention of
people who do know win32, and ensures that it won't get dropped on the
floor totally.
-- René
¹ more accurately: if mswindows_handle_mousewheel_event doesn't handle the event.
---
src/event-msw.c.org 2003-07-30 22:11:54.000000000 +0200
+++ src/event-msw.c 2003-07-30 22:24:42.000000000 +0200
@@ -981,6 +981,9 @@
int downp = (msg == WM_LBUTTONDOWN || msg == WM_MBUTTONDOWN ||
msg == WM_RBUTTONDOWN);
+ /* Wheel rotation amount: positive is away from user, negative towards user */
+ int delta = (short) HIWORD (mods);
+
/* We always use last message time, because mouse button
events may get delayed, and XEmacs double click
recognition will fail */
@@ -993,7 +996,9 @@
event->timestamp = when;
event->event.button.button =
(msg==WM_LBUTTONDOWN || msg==WM_LBUTTONUP) ? 1 :
- ((msg==WM_RBUTTONDOWN || msg==WM_RBUTTONUP) ? 3 : 2);
+ (msg==WM_MBUTTONDOWN || msg==WM_MBUTTONUP) ? 2 :
+ (msg==WM_RBUTTONDOWN || msg==WM_RBUTTONUP) ? 3 :
+ (msg==WM_MOUSEWHEEL && delta>0) ? 4 : 5;
event->event.button.x = where.x;
event->event.button.y = where.y;
event->event.button.modifiers = mswindows_modifier_state (NULL, mods, 0);
@@ -2950,13 +2955,18 @@
int keys = LOWORD (wParam); /* Modifier key flags */
int delta = (short) HIWORD (wParam); /* Wheel rotation amount */
- if (mswindows_handle_mousewheel_event (mswindows_find_frame (hwnd),
+ /* enqueue button4/5 events if mswindows_handle_mousewheel_event
+ doesn't handle the event, such as when the scrollbars are not
+ displayed */
+ if (!mswindows_handle_mousewheel_event (mswindows_find_frame (hwnd),
keys, delta,
MAKEPOINTS (lParam)))
- /* We are not in a modal loop so no pumping is necessary. */
- break;
- else
- goto defproc;
+ mswindows_enqueue_mouse_button_event (hwnd, message_,
+ MAKEPOINTS (lParam),
+ wParam,
+ GetMessageTime());
+ /* We are not in a modal loop so no pumping is necessary. */
+ break;
}
#endif
--
Institute of Policy and Planning Sciences
http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Ask not how you can "do" free software business;
ask what your business can "do for" free software.