comparison src/keyboard.c @ 12712:33dc35e15fd2

(kbd_buffer_get_event): Update input_pending after discarding one event from the queue, if we process the event here. (swallow_events): Likewise. (Vkey_translation_map): Just declare, don't define. (syms_of_keyboard): Don't set up Lisp var.
author Richard M. Stallman <rms@gnu.org>
date Fri, 28 Jul 1995 16:36:01 +0000
parents 1243af8addb5
children 21110e58640c
comparison
equal deleted inserted replaced
12711:a8feaa42d775 12712:33dc35e15fd2
308 Lisp_Object Vkeyboard_translate_table; 308 Lisp_Object Vkeyboard_translate_table;
309 309
310 /* Keymap mapping ASCII function key sequences onto their preferred forms. */ 310 /* Keymap mapping ASCII function key sequences onto their preferred forms. */
311 extern Lisp_Object Vfunction_key_map; 311 extern Lisp_Object Vfunction_key_map;
312 312
313 /* Keymap mapping ASCII function key sequences onto their preferred forms. */ 313 /* Another keymap that maps key sequences into key sequences.
314 Lisp_Object Vkey_translation_map; 314 This one takes precedence over ordinary definitions. */
315 extern Lisp_Object Vkey_translation_map;
315 316
316 /* Non-nil means deactivate the mark at end of this command. */ 317 /* Non-nil means deactivate the mark at end of this command. */
317 Lisp_Object Vdeactivate_mark; 318 Lisp_Object Vdeactivate_mark;
318 319
319 /* Menu bar specified in Lucid Emacs fashion. */ 320 /* Menu bar specified in Lucid Emacs fashion. */
2561 /* Remove it from the buffer before processing it, 2562 /* Remove it from the buffer before processing it,
2562 since otherwise swallow_events will see it 2563 since otherwise swallow_events will see it
2563 and process it again. */ 2564 and process it again. */
2564 copy = *event; 2565 copy = *event;
2565 kbd_fetch_ptr = event + 1; 2566 kbd_fetch_ptr = event + 1;
2567 input_pending = readable_events ();
2566 x_handle_selection_request (&copy); 2568 x_handle_selection_request (&copy);
2567 #else 2569 #else
2568 /* We're getting selection request events, but we don't have 2570 /* We're getting selection request events, but we don't have
2569 a window system. */ 2571 a window system. */
2570 abort (); 2572 abort ();
2572 } 2574 }
2573 2575
2574 else if (event->kind == selection_clear_event) 2576 else if (event->kind == selection_clear_event)
2575 { 2577 {
2576 #ifdef HAVE_X11 2578 #ifdef HAVE_X11
2579 struct input_event copy;
2580
2581 /* Remove it from the buffer before processing it. */
2582 copy = *event;
2577 kbd_fetch_ptr = event + 1; 2583 kbd_fetch_ptr = event + 1;
2584 input_pending = readable_events ();
2578 x_handle_selection_clear (event); 2585 x_handle_selection_clear (event);
2579 #else 2586 #else
2580 /* We're getting selection request events, but we don't have 2587 /* We're getting selection request events, but we don't have
2581 a window system. */ 2588 a window system. */
2582 abort (); 2589 abort ();
2613 } 2620 }
2614 #ifdef USE_X_TOOLKIT 2621 #ifdef USE_X_TOOLKIT
2615 else if (event->kind == menu_bar_activate_event) 2622 else if (event->kind == menu_bar_activate_event)
2616 { 2623 {
2617 kbd_fetch_ptr = event + 1; 2624 kbd_fetch_ptr = event + 1;
2625 input_pending = readable_events ();
2618 x_activate_menubar (XFRAME (event->frame_or_window)); 2626 x_activate_menubar (XFRAME (event->frame_or_window));
2619 } 2627 }
2620 #endif 2628 #endif
2621 /* Just discard these, by returning nil. 2629 /* Just discard these, by returning nil.
2622 With MULTI_KBOARD, these events are used as placeholders 2630 With MULTI_KBOARD, these events are used as placeholders
2755 and don't actually appear to the command loop. */ 2763 and don't actually appear to the command loop. */
2756 if (event->kind == selection_request_event) 2764 if (event->kind == selection_request_event)
2757 { 2765 {
2758 #ifdef HAVE_X11 2766 #ifdef HAVE_X11
2759 struct input_event copy; 2767 struct input_event copy;
2768
2769 /* Remove it from the buffer before processing it,
2770 since otherwise swallow_events called recursively could see it
2771 and process it again. */
2760 copy = *event; 2772 copy = *event;
2761 kbd_fetch_ptr = event + 1; 2773 kbd_fetch_ptr = event + 1;
2774 input_pending = readable_events ();
2762 x_handle_selection_request (&copy); 2775 x_handle_selection_request (&copy);
2763 #else 2776 #else
2764 /* We're getting selection request events, but we don't have 2777 /* We're getting selection request events, but we don't have
2765 a window system. */ 2778 a window system. */
2766 abort (); 2779 abort ();
2768 } 2781 }
2769 2782
2770 else if (event->kind == selection_clear_event) 2783 else if (event->kind == selection_clear_event)
2771 { 2784 {
2772 #ifdef HAVE_X11 2785 #ifdef HAVE_X11
2786 struct input_event copy;
2787
2788 /* Remove it from the buffer before processing it, */
2789 copy = *event;
2790
2791 kbd_fetch_ptr = event + 1;
2792 input_pending = readable_events ();
2773 x_handle_selection_clear (event); 2793 x_handle_selection_clear (event);
2774 kbd_fetch_ptr = event + 1;
2775 #else 2794 #else
2776 /* We're getting selection request events, but we don't have 2795 /* We're getting selection request events, but we don't have
2777 a window system. */ 2796 a window system. */
2778 abort (); 2797 abort ();
2779 #endif 2798 #endif
7161 "String used as translate table for keyboard input, or nil.\n\ 7180 "String used as translate table for keyboard input, or nil.\n\
7162 Each character is looked up in this string and the contents used instead.\n\ 7181 Each character is looked up in this string and the contents used instead.\n\
7163 If string is of length N, character codes N and up are untranslated."); 7182 If string is of length N, character codes N and up are untranslated.");
7164 Vkeyboard_translate_table = Qnil; 7183 Vkeyboard_translate_table = Qnil;
7165 7184
7166 DEFVAR_LISP ("key-translation-map", &Vkey_translation_map,
7167 "Keymap of key translations that can override keymaps.\n\
7168 This keymap works like `function-key-map', but comes after that,\n\
7169 and applies even for keys that have ordinary bindings.");
7170 Vkey_translation_map = Qnil;
7171
7172 DEFVAR_BOOL ("cannot-suspend", &cannot_suspend, 7185 DEFVAR_BOOL ("cannot-suspend", &cannot_suspend,
7173 "Non-nil means to always spawn a subshell instead of suspending,\n\ 7186 "Non-nil means to always spawn a subshell instead of suspending,\n\
7174 even if the operating system has support for stopping a process."); 7187 even if the operating system has support for stopping a process.");
7175 cannot_suspend = 0; 7188 cannot_suspend = 0;
7176 7189