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 */
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);
* Timeout event matches if interval_id is equal to that of the given event.
* Keypress event matches if logical AND between modifiers bitmask of the
* event in the queue and that of the given event is non-zero.
- * For all other event types, this function aborts.
+ * For all other event types, this function ABORTs.
*/
Lisp_Object
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
FROB (WM_GETHOTKEY)
FROB (WM_QUERYDRAGICON)
FROB (WM_COMPAREITEM)
-#if(WINVER >= 0x0500)
+#if(WINVER >= 0x0500) && defined(WM_GETOBJECT)
FROB (WM_GETOBJECT)
#endif /* WINVER >= 0x0500 */
FROB (WM_COMPACTING)
FROB (WM_ENTERIDLE)
#if(WINVER >= 0x0500)
FROB (WM_MENURBUTTONUP)
+#ifdef WM_MENUDRAG
FROB (WM_MENUDRAG)
+#endif
+#ifdef WM_MENUGETOBJECT
FROB (WM_MENUGETOBJECT)
+#endif
+#ifdef WM_UNINITMENUPOPUP
FROB (WM_UNINITMENUPOPUP)
+#endif
+#ifdef WM_MENUCOMMAND
FROB (WM_MENUCOMMAND)
+#endif
#endif /* WINVER >= 0x0500 */
FROB (WM_IME_SELECT)
FROB (WM_IME_CHAR)
#endif /* WINVER >= 0x0400 */
-#if(WINVER >= 0x0500)
+#if(WINVER >= 0x0500) && defined(WM_IME_REQUEST)
FROB (WM_IME_REQUEST)
#endif /* WINVER >= 0x0500 */
#if(WINVER >= 0x0400) && !defined(CYGWIN)