- FRAME_PTR f = SELECTED_FRAME ();
- Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
- int mx = event->dwMousePosition.X, my = event->dwMousePosition.Y;
-
- mouse_moved_to (mx, my);
-
- if (f->mouse_moved)
- {
- if (hlinfo->mouse_face_hidden)
- {
- hlinfo->mouse_face_hidden = 0;
- clear_mouse_face (hlinfo);
- }
-
- /* Generate SELECT_WINDOW_EVENTs when needed. */
- if (!NILP (Vmouse_autoselect_window))
- {
- Lisp_Object mouse_window = window_from_coordinates (f, mx, my,
- 0, 0);
- /* A window will be selected only when it is not
- selected now, and the last mouse movement event was
- not in it. A minibuffer window will be selected iff
- it is active. */
- if (WINDOWP (mouse_window)
- && !EQ (mouse_window, last_mouse_window)
- && !EQ (mouse_window, selected_window))
- {
- struct input_event event;
-
- EVENT_INIT (event);
- event.kind = SELECT_WINDOW_EVENT;
- event.frame_or_window = mouse_window;
- event.arg = Qnil;
- event.timestamp = movement_time;
- kbd_buffer_store_event (&event);
- }
- last_mouse_window = mouse_window;
- }
- else
- last_mouse_window = Qnil;
-
- previous_help_echo_string = help_echo_string;
- help_echo_string = help_echo_object = help_echo_window = Qnil;
- help_echo_pos = -1;
- note_mouse_highlight (f, mx, my);
- /* If the contents of the global variable help_echo has
- changed (inside note_mouse_highlight), generate a HELP_EVENT. */
- if (!NILP (help_echo_string) || !NILP (previous_help_echo_string))
- gen_help_event (help_echo_string, selected_frame, help_echo_window,
- help_echo_object, help_echo_pos);
- }
- return 0;
- }
-
- /* It looks like the console code sends us a mouse event with
- dwButtonState == 0 when a window is activated. Ignore this case. */
- if (event->dwButtonState == button_state)
- return 0;
-
- emacs_ev->kind = MOUSE_CLICK_EVENT;
-
- /* Find out what button has changed state since the last button event. */
- but_change = button_state ^ event->dwButtonState;
- mask = 1;
- for (i = 0; mask; i++, mask <<= 1)
- if (but_change & mask)