comparison src/keyboard.c @ 3993:992a1abeb6cd

* keyboard.c (Vdouble_click_time): Renamed from double_click_time, and made a Lisp_Object instead of an int. (make_lispy_event): If Vdouble_click_time is t, impose no time limit on double-clicks. (syms_of_keyboard): DEFVAR_LISP (not DEFVAR_INT) Vdouble_click_time (not double_click_time), and adjust doc string to say that `nil' means no double clicks, and `t' means no time limit.
author Jim Blandy <jimb@redhat.com>
date Mon, 05 Jul 1993 07:18:24 +0000
parents e49ff3115e7d
children df443e5f391e
comparison
equal deleted inserted replaced
3992:cb593618786e 3993:992a1abeb6cd
2155 static int button_up_button; 2155 static int button_up_button;
2156 static int button_up_x; 2156 static int button_up_x;
2157 static int button_up_y; 2157 static int button_up_y;
2158 static unsigned long button_up_time; 2158 static unsigned long button_up_time;
2159 2159
2160 /* The minimum time between clicks to make a double-click. */ 2160 /* The maximum time between clicks to make a double-click,
2161 2161 or Qnil to disable double-click detection,
2162 int double_click_time; 2162 or Qt for no time limit. */
2163 Lisp_Object Vdouble_click_time;
2163 2164
2164 /* The number of clicks in this multiple-click. */ 2165 /* The number of clicks in this multiple-click. */
2165 2166
2166 int double_click_count; 2167 int double_click_count;
2167 2168
2345 { 2346 {
2346 if (button == button_up_button 2347 if (button == button_up_button
2347 && XINT (event->x) == button_up_x 2348 && XINT (event->x) == button_up_x
2348 && XINT (event->y) == button_up_y 2349 && XINT (event->y) == button_up_y
2349 && button_up_time != 0 2350 && button_up_time != 0
2350 && ((int)(event->timestamp - button_up_time) 2351 && (EQ (Vdouble_click_time, Qt)
2351 < double_click_time)) 2352 || (INTEGERP (Vdouble_click_time)
2353 && ((int)(event->timestamp - button_up_time)
2354 < XINT (Vdouble_click_time)))))
2352 { 2355 {
2353 double_click_count++; 2356 double_click_count++;
2354 event->modifiers |= ((double_click_count > 2) 2357 event->modifiers |= ((double_click_count > 2)
2355 ? triple_modifier 2358 ? triple_modifier
2356 : double_modifier); 2359 : double_modifier);
5082 The reason for polling is to make C-g work to stop a running program.\n\ 5085 The reason for polling is to make C-g work to stop a running program.\n\
5083 Polling is needed only when using X windows and SIGIO does not work.\n\ 5086 Polling is needed only when using X windows and SIGIO does not work.\n\
5084 Polling is automatically disabled in all other cases."); 5087 Polling is automatically disabled in all other cases.");
5085 polling_period = 2; 5088 polling_period = 2;
5086 5089
5087 DEFVAR_INT ("double-click-time", &double_click_time, 5090 DEFVAR_LISP ("double-click-time", &Vdouble_click_time,
5088 "*Maximum time between mouse clicks to make a double-click.\n\ 5091 "*Maximum time between mouse clicks to make a double-click.\n\
5089 Measured in milliseconds. Zero means disable double-click recognition;\n\ 5092 Measured in milliseconds. nil means disable double-click recognition;\n\
5090 a large number means double-clicks have no time limit and are detected\n\ 5093 t means double-clicks have no time limit and are detected\n\
5091 by position only."); 5094 by position only.");
5092 double_click_time = 500; 5095 double_click_time = 500;
5093 5096
5094 DEFVAR_INT ("num-input-keys", &num_input_keys, 5097 DEFVAR_INT ("num-input-keys", &num_input_keys,
5095 "*Number of complete keys read from the keyboard so far."); 5098 "*Number of complete keys read from the keyboard so far.");