changeset 15165:aa3de03facd8

(Qup, Qdown): New variables. (syms_of_keyboard): Initialize and staticpro. (scroll_bar_parts): Add Qup and Qdown. (make_lispy_event) [WINDOWSNT]: Handle win32_scroll_bar_click. (command_loop_1): Clear echo area while inhibit-quit is still t.
author Richard M. Stallman <rms@gnu.org>
date Sun, 05 May 1996 04:35:53 +0000
parents f7cdb1d402cc
children 83258eb2ede5
files src/keyboard.c
diffstat 1 files changed, 66 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/keyboard.c	Sun May 05 04:33:42 1996 +0000
+++ b/src/keyboard.c	Sun May 05 04:35:53 1996 +0000
@@ -1123,12 +1123,13 @@
 	     rather than quitting back to the minibuffer.  */
 	  int count = specpdl_ptr - specpdl;
 	  specbind (Qinhibit_quit, Qt);
+
 	  Fsit_for (make_number (2), Qnil, Qnil);
-	  unbind_to (count, Qnil);
-
 	  /* Clear the echo area.  */
 	  message2 (0);
 
+	  unbind_to (count, Qnil);
+
 	  /* If a C-g came in before, treat it as input now.  */
 	  if (!NILP (Vquit_flag))
 	    {
@@ -3549,10 +3550,12 @@
 
 /* Scroll bar parts.  */
 Lisp_Object Qabove_handle, Qhandle, Qbelow_handle;
+Lisp_Object Qup, Qdown;
 
 /* An array of scroll bar parts, indexed by an enum scroll_bar_part value.  */
 Lisp_Object *scroll_bar_parts[] = {
-  &Qabove_handle, &Qhandle, &Qbelow_handle
+  &Qabove_handle, &Qhandle, &Qbelow_handle,
+  &Qup, &Qdown,
 };
 
 
@@ -3790,12 +3793,12 @@
 	    portion_whole = Fcons (event->x, event->y);
 	    part = *scroll_bar_parts[(int) event->part];
 
-	    position =
-	      Fcons (window,
-		     Fcons (Qvertical_scroll_bar,
-			    Fcons (portion_whole,
-				   Fcons (make_number (event->timestamp),
-					  Fcons (part, Qnil)))));
+	    position
+	      = Fcons (window,
+		       Fcons (Qvertical_scroll_bar,
+			      Fcons (portion_whole,
+				     Fcons (make_number (event->timestamp),
+					    Fcons (part, Qnil)))));
 	  }
 
 	start_pos_ptr = &XVECTOR (button_down_location)->contents[button];
@@ -3907,6 +3910,56 @@
 				 Qnil));
 	}
       }
+
+#ifdef WINDOWSNT
+    case win32_scroll_bar_click:
+      {
+	int button = event->code;
+	int is_double;
+	Lisp_Object position;
+	Lisp_Object *start_pos_ptr;
+	Lisp_Object start_pos;
+
+	if (button < 0 || button >= NUM_MOUSE_BUTTONS)
+	  abort ();
+
+	{
+	  Lisp_Object window;
+	  Lisp_Object portion_whole;
+	  Lisp_Object part;
+
+	  window = event->frame_or_window;
+	  portion_whole = Fcons (event->x, event->y);
+	  part = *scroll_bar_parts[(int) event->part];
+
+	  position =
+	    Fcons (window,
+		   Fcons (Qvertical_scroll_bar,
+			  Fcons (portion_whole,
+				 Fcons (make_number (event->timestamp),
+					Fcons (part, Qnil)))));
+	}
+
+	/* Always treat Win32 scroll bar events as clicks. */
+	event->modifiers |= click_modifier;
+
+	{
+	  /* Get the symbol we should use for the mouse click.  */
+	  Lisp_Object head;
+
+	  head = modify_event_symbol (button,
+				      event->modifiers,
+				      Qmouse_click, Qnil,
+				      lispy_mouse_names, &mouse_syms,
+				      (sizeof (lispy_mouse_names)
+				       / sizeof (lispy_mouse_names[0])));
+	  return Fcons (head,
+			Fcons (position,
+			       Qnil));
+	}
+      }
+#endif
+
 #endif /* HAVE_MOUSE */
 
 #if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI)
@@ -7763,6 +7816,10 @@
   staticpro (&Qhandle);
   Qbelow_handle = intern ("below-handle");
   staticpro (&Qbelow_handle);
+  Qup = intern ("up");
+  staticpro (&Qup);
+  Qdown = intern ("down");
+  staticpro (&Qdown);
 
   Qevent_kind = intern ("event-kind");
   staticpro (&Qevent_kind);