Mercurial > emacs
comparison src/w32fns.c @ 42719:70f13c4f82c7
(w32_pass_extra_mouse_buttons_to_system): New user option.
(syms_of_w32fns): DEFVAR_BOOL it.
(w32_wnd_proc): Handle new "XBUTTON" messages.
author | Jason Rumney <jasonr@gnu.org> |
---|---|
date | Sun, 13 Jan 2002 12:14:56 +0000 |
parents | f0e15bcba768 |
children | 4510d4d4bac4 |
comparison
equal
deleted
inserted
replaced
42718:0546caffda34 | 42719:70f13c4f82c7 |
---|---|
139 Lisp_Object Vw32_mouse_button_tolerance; | 139 Lisp_Object Vw32_mouse_button_tolerance; |
140 | 140 |
141 /* Minimum interval between mouse movement (and scroll bar drag) | 141 /* Minimum interval between mouse movement (and scroll bar drag) |
142 events that are passed on to the event loop. */ | 142 events that are passed on to the event loop. */ |
143 Lisp_Object Vw32_mouse_move_interval; | 143 Lisp_Object Vw32_mouse_move_interval; |
144 | |
145 /* Flag to indicate if XBUTTON events should be passed on to Windows. */ | |
146 int w32_pass_extra_mouse_buttons_to_system; | |
144 | 147 |
145 /* The name we're using in resource queries. */ | 148 /* The name we're using in resource queries. */ |
146 Lisp_Object Vx_resource_name; | 149 Lisp_Object Vx_resource_name; |
147 | 150 |
148 /* Non nil if no window manager is in use. */ | 151 /* Non nil if no window manager is in use. */ |
4568 if (button_state == 0) | 4571 if (button_state == 0) |
4569 ReleaseCapture (); | 4572 ReleaseCapture (); |
4570 } | 4573 } |
4571 return 0; | 4574 return 0; |
4572 | 4575 |
4576 case WM_XBUTTONDOWN: | |
4577 case WM_XBUTTONUP: | |
4578 if (w32_pass_extra_mouse_buttons_to_system) | |
4579 goto dflt; | |
4580 /* else fall through and process them. */ | |
4573 case WM_MBUTTONDOWN: | 4581 case WM_MBUTTONDOWN: |
4574 case WM_MBUTTONUP: | 4582 case WM_MBUTTONUP: |
4575 handle_plain_button: | 4583 handle_plain_button: |
4576 { | 4584 { |
4577 BOOL up; | 4585 BOOL up; |
4578 int button; | 4586 int button; |
4579 | 4587 |
4580 if (parse_button (msg, &button, &up)) | 4588 if (parse_button (msg, HIWORD (wParam), &button, &up)) |
4581 { | 4589 { |
4582 if (up) ReleaseCapture (); | 4590 if (up) ReleaseCapture (); |
4583 else SetCapture (hwnd); | 4591 else SetCapture (hwnd); |
4584 button = (button == 0) ? LMOUSE : | 4592 button = (button == 0) ? LMOUSE : |
4585 ((button == 1) ? MMOUSE : RMOUSE); | 4593 ((button == 1) ? MMOUSE : RMOUSE); |
4590 } | 4598 } |
4591 } | 4599 } |
4592 | 4600 |
4593 wmsg.dwModifiers = w32_get_modifiers (); | 4601 wmsg.dwModifiers = w32_get_modifiers (); |
4594 my_post_msg (&wmsg, hwnd, msg, wParam, lParam); | 4602 my_post_msg (&wmsg, hwnd, msg, wParam, lParam); |
4595 return 0; | 4603 |
4604 /* Need to return true for XBUTTON messages, false for others, | |
4605 to indicate that we processed the message. */ | |
4606 return (msg == WM_XBUTTONDOWN || msg == WM_XBUTTONUP); | |
4596 | 4607 |
4597 case WM_MOUSEMOVE: | 4608 case WM_MOUSEMOVE: |
4598 /* If the mouse has just moved into the frame, start tracking | 4609 /* If the mouse has just moved into the frame, start tracking |
4599 it, so we will be notified when it leaves the frame. Mouse | 4610 it, so we will be notified when it leaves the frame. Mouse |
4600 tracking only works under W98 and NT4 and later. On earlier | 4611 tracking only works under W98 and NT4 and later. On earlier |
14505 The value is the minimum time in milliseconds that must elapse between | 14516 The value is the minimum time in milliseconds that must elapse between |
14506 successive mouse move (or scroll bar drag) events before they are | 14517 successive mouse move (or scroll bar drag) events before they are |
14507 reported as lisp events. */); | 14518 reported as lisp events. */); |
14508 XSETINT (Vw32_mouse_move_interval, 0); | 14519 XSETINT (Vw32_mouse_move_interval, 0); |
14509 | 14520 |
14521 DEFVAR_BOOL ("w32-pass-extra-mouse-buttons-to-system", | |
14522 &w32_pass_extra_mouse_buttons_to_system, | |
14523 doc: /* Non-nil if the fourth and fifth mouse buttons are passed to Windows. | |
14524 Recent versions of Windows support mice with up to five buttons. | |
14525 Since most applications don't support these extra buttons, most mouse | |
14526 drivers will allow you to map them to functions at the system level. | |
14527 If this variable is non-nil, Emacs will pass them on, allowing the | |
14528 system to handle them. */); | |
14529 w32_pass_extra_mouse_buttons_to_system = 0; | |
14530 | |
14510 init_x_parm_symbols (); | 14531 init_x_parm_symbols (); |
14511 | 14532 |
14512 DEFVAR_LISP ("x-bitmap-file-path", &Vx_bitmap_file_path, | 14533 DEFVAR_LISP ("x-bitmap-file-path", &Vx_bitmap_file_path, |
14513 doc: /* List of directories to search for bitmap files for w32. */); | 14534 doc: /* List of directories to search for bitmap files for w32. */); |
14514 Vx_bitmap_file_path = decode_env_path ((char *) 0, "PATH"); | 14535 Vx_bitmap_file_path = decode_env_path ((char *) 0, "PATH"); |