diff options
| author | Richard M. Stallman | 1996-05-05 04:35:53 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-05-05 04:35:53 +0000 |
| commit | db08707d4f289794f4268c2257c3ee190e1c7871 (patch) | |
| tree | 54df1facbf1f466ca24ec26914c054c096c4318d /src | |
| parent | ebb0719c46bf2a7856696ec283f6d1159093c79e (diff) | |
| download | emacs-db08707d4f289794f4268c2257c3ee190e1c7871.tar.gz emacs-db08707d4f289794f4268c2257c3ee190e1c7871.zip | |
(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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 75 |
1 files changed, 66 insertions, 9 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index db9d6a50639..20efcf47f55 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -1123,12 +1123,13 @@ command_loop_1 () | |||
| 1123 | rather than quitting back to the minibuffer. */ | 1123 | rather than quitting back to the minibuffer. */ |
| 1124 | int count = specpdl_ptr - specpdl; | 1124 | int count = specpdl_ptr - specpdl; |
| 1125 | specbind (Qinhibit_quit, Qt); | 1125 | specbind (Qinhibit_quit, Qt); |
| 1126 | Fsit_for (make_number (2), Qnil, Qnil); | ||
| 1127 | unbind_to (count, Qnil); | ||
| 1128 | 1126 | ||
| 1127 | Fsit_for (make_number (2), Qnil, Qnil); | ||
| 1129 | /* Clear the echo area. */ | 1128 | /* Clear the echo area. */ |
| 1130 | message2 (0); | 1129 | message2 (0); |
| 1131 | 1130 | ||
| 1131 | unbind_to (count, Qnil); | ||
| 1132 | |||
| 1132 | /* If a C-g came in before, treat it as input now. */ | 1133 | /* If a C-g came in before, treat it as input now. */ |
| 1133 | if (!NILP (Vquit_flag)) | 1134 | if (!NILP (Vquit_flag)) |
| 1134 | { | 1135 | { |
| @@ -3549,10 +3550,12 @@ static char *lispy_mouse_names[] = | |||
| 3549 | 3550 | ||
| 3550 | /* Scroll bar parts. */ | 3551 | /* Scroll bar parts. */ |
| 3551 | Lisp_Object Qabove_handle, Qhandle, Qbelow_handle; | 3552 | Lisp_Object Qabove_handle, Qhandle, Qbelow_handle; |
| 3553 | Lisp_Object Qup, Qdown; | ||
| 3552 | 3554 | ||
| 3553 | /* An array of scroll bar parts, indexed by an enum scroll_bar_part value. */ | 3555 | /* An array of scroll bar parts, indexed by an enum scroll_bar_part value. */ |
| 3554 | Lisp_Object *scroll_bar_parts[] = { | 3556 | Lisp_Object *scroll_bar_parts[] = { |
| 3555 | &Qabove_handle, &Qhandle, &Qbelow_handle | 3557 | &Qabove_handle, &Qhandle, &Qbelow_handle, |
| 3558 | &Qup, &Qdown, | ||
| 3556 | }; | 3559 | }; |
| 3557 | 3560 | ||
| 3558 | 3561 | ||
| @@ -3790,12 +3793,12 @@ make_lispy_event (event) | |||
| 3790 | portion_whole = Fcons (event->x, event->y); | 3793 | portion_whole = Fcons (event->x, event->y); |
| 3791 | part = *scroll_bar_parts[(int) event->part]; | 3794 | part = *scroll_bar_parts[(int) event->part]; |
| 3792 | 3795 | ||
| 3793 | position = | 3796 | position |
| 3794 | Fcons (window, | 3797 | = Fcons (window, |
| 3795 | Fcons (Qvertical_scroll_bar, | 3798 | Fcons (Qvertical_scroll_bar, |
| 3796 | Fcons (portion_whole, | 3799 | Fcons (portion_whole, |
| 3797 | Fcons (make_number (event->timestamp), | 3800 | Fcons (make_number (event->timestamp), |
| 3798 | Fcons (part, Qnil))))); | 3801 | Fcons (part, Qnil))))); |
| 3799 | } | 3802 | } |
| 3800 | 3803 | ||
| 3801 | start_pos_ptr = &XVECTOR (button_down_location)->contents[button]; | 3804 | start_pos_ptr = &XVECTOR (button_down_location)->contents[button]; |
| @@ -3907,6 +3910,56 @@ make_lispy_event (event) | |||
| 3907 | Qnil)); | 3910 | Qnil)); |
| 3908 | } | 3911 | } |
| 3909 | } | 3912 | } |
| 3913 | |||
| 3914 | #ifdef WINDOWSNT | ||
| 3915 | case win32_scroll_bar_click: | ||
| 3916 | { | ||
| 3917 | int button = event->code; | ||
| 3918 | int is_double; | ||
| 3919 | Lisp_Object position; | ||
| 3920 | Lisp_Object *start_pos_ptr; | ||
| 3921 | Lisp_Object start_pos; | ||
| 3922 | |||
| 3923 | if (button < 0 || button >= NUM_MOUSE_BUTTONS) | ||
| 3924 | abort (); | ||
| 3925 | |||
| 3926 | { | ||
| 3927 | Lisp_Object window; | ||
| 3928 | Lisp_Object portion_whole; | ||
| 3929 | Lisp_Object part; | ||
| 3930 | |||
| 3931 | window = event->frame_or_window; | ||
| 3932 | portion_whole = Fcons (event->x, event->y); | ||
| 3933 | part = *scroll_bar_parts[(int) event->part]; | ||
| 3934 | |||
| 3935 | position = | ||
| 3936 | Fcons (window, | ||
| 3937 | Fcons (Qvertical_scroll_bar, | ||
| 3938 | Fcons (portion_whole, | ||
| 3939 | Fcons (make_number (event->timestamp), | ||
| 3940 | Fcons (part, Qnil))))); | ||
| 3941 | } | ||
| 3942 | |||
| 3943 | /* Always treat Win32 scroll bar events as clicks. */ | ||
| 3944 | event->modifiers |= click_modifier; | ||
| 3945 | |||
| 3946 | { | ||
| 3947 | /* Get the symbol we should use for the mouse click. */ | ||
| 3948 | Lisp_Object head; | ||
| 3949 | |||
| 3950 | head = modify_event_symbol (button, | ||
| 3951 | event->modifiers, | ||
| 3952 | Qmouse_click, Qnil, | ||
| 3953 | lispy_mouse_names, &mouse_syms, | ||
| 3954 | (sizeof (lispy_mouse_names) | ||
| 3955 | / sizeof (lispy_mouse_names[0]))); | ||
| 3956 | return Fcons (head, | ||
| 3957 | Fcons (position, | ||
| 3958 | Qnil)); | ||
| 3959 | } | ||
| 3960 | } | ||
| 3961 | #endif | ||
| 3962 | |||
| 3910 | #endif /* HAVE_MOUSE */ | 3963 | #endif /* HAVE_MOUSE */ |
| 3911 | 3964 | ||
| 3912 | #if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) | 3965 | #if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) |
| @@ -7763,6 +7816,10 @@ syms_of_keyboard () | |||
| 7763 | staticpro (&Qhandle); | 7816 | staticpro (&Qhandle); |
| 7764 | Qbelow_handle = intern ("below-handle"); | 7817 | Qbelow_handle = intern ("below-handle"); |
| 7765 | staticpro (&Qbelow_handle); | 7818 | staticpro (&Qbelow_handle); |
| 7819 | Qup = intern ("up"); | ||
| 7820 | staticpro (&Qup); | ||
| 7821 | Qdown = intern ("down"); | ||
| 7822 | staticpro (&Qdown); | ||
| 7766 | 7823 | ||
| 7767 | Qevent_kind = intern ("event-kind"); | 7824 | Qevent_kind = intern ("event-kind"); |
| 7768 | staticpro (&Qevent_kind); | 7825 | staticpro (&Qevent_kind); |