X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fevent-msw.c;h=2b410167bb6e64f04b7ba565e14a3af43bd40ba7;hb=166ba1350d802535b6a6ea7ea0bc29c56a71b7ec;hp=09bfe6df8152ae2025eeb6f2f934c9539af3d8fa;hpb=ac7d0619aad74b1d57c4748ebb3ab29d9c32e3d8;p=chise%2Fxemacs-chise.git.1 diff --git a/src/event-msw.c b/src/event-msw.c index 09bfe6d..2b41016 100644 --- a/src/event-msw.c +++ b/src/event-msw.c @@ -981,6 +981,9 @@ mswindows_enqueue_mouse_button_event (HWND hwnd, UINT msg, POINTS where, 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 @@ mswindows_enqueue_mouse_button_event (HWND hwnd, UINT msg, POINTS where, 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); @@ -1069,7 +1074,7 @@ mswindows_dequeue_dispatch_event (void) * 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 @@ -2950,13 +2955,18 @@ mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam) 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 @@ -3865,7 +3875,7 @@ FROB (WM_SETHOTKEY) 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) @@ -3947,10 +3957,18 @@ FROB (WM_MENUCHAR) 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 */ @@ -4026,7 +4044,7 @@ FROB (WM_IME_COMPOSITIONFULL) 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)