summaryrefslogtreecommitdiff
path: root/src/w32fns.c
diff options
context:
space:
mode:
authorJason Rumney <jasonr@gnu.org>2002-01-13 12:14:56 +0000
committerJason Rumney <jasonr@gnu.org>2002-01-13 12:14:56 +0000
commit742145478bc9c3ad900ca8bad82b9eb87893eaad (patch)
treec6428b8ae6ef61b42ae123096cfae1aa3fb266f4 /src/w32fns.c
parent76e4fd8c61b4bb3d045fd1fdd541a821184ba4d6 (diff)
downloademacs-742145478bc9c3ad900ca8bad82b9eb87893eaad.tar.gz
(w32_pass_extra_mouse_buttons_to_system): New user option.
(syms_of_w32fns): DEFVAR_BOOL it. (w32_wnd_proc): Handle new "XBUTTON" messages.
Diffstat (limited to 'src/w32fns.c')
-rw-r--r--src/w32fns.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index d9587b8b4bb..a2b83c67bd3 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -142,6 +142,9 @@ Lisp_Object Vw32_mouse_button_tolerance;
events that are passed on to the event loop. */
Lisp_Object Vw32_mouse_move_interval;
+/* Flag to indicate if XBUTTON events should be passed on to Windows. */
+int w32_pass_extra_mouse_buttons_to_system;
+
/* The name we're using in resource queries. */
Lisp_Object Vx_resource_name;
@@ -4570,6 +4573,11 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
}
return 0;
+ case WM_XBUTTONDOWN:
+ case WM_XBUTTONUP:
+ if (w32_pass_extra_mouse_buttons_to_system)
+ goto dflt;
+ /* else fall through and process them. */
case WM_MBUTTONDOWN:
case WM_MBUTTONUP:
handle_plain_button:
@@ -4577,7 +4585,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
BOOL up;
int button;
- if (parse_button (msg, &button, &up))
+ if (parse_button (msg, HIWORD (wParam), &button, &up))
{
if (up) ReleaseCapture ();
else SetCapture (hwnd);
@@ -4592,7 +4600,10 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
wmsg.dwModifiers = w32_get_modifiers ();
my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
- return 0;
+
+ /* Need to return true for XBUTTON messages, false for others,
+ to indicate that we processed the message. */
+ return (msg == WM_XBUTTONDOWN || msg == WM_XBUTTONUP);
case WM_MOUSEMOVE:
/* If the mouse has just moved into the frame, start tracking
@@ -14507,6 +14518,16 @@ successive mouse move (or scroll bar drag) events before they are
reported as lisp events. */);
XSETINT (Vw32_mouse_move_interval, 0);
+ DEFVAR_BOOL ("w32-pass-extra-mouse-buttons-to-system",
+ &w32_pass_extra_mouse_buttons_to_system,
+ doc: /* Non-nil if the fourth and fifth mouse buttons are passed to Windows.
+Recent versions of Windows support mice with up to five buttons.
+Since most applications don't support these extra buttons, most mouse
+drivers will allow you to map them to functions at the system level.
+If this variable is non-nil, Emacs will pass them on, allowing the
+system to handle them. */);
+ w32_pass_extra_mouse_buttons_to_system = 0;
+
init_x_parm_symbols ();
DEFVAR_LISP ("x-bitmap-file-path", &Vx_bitmap_file_path,