3698 |
Discard the event if it would fill the last slot. */ |
Discard the event if it would fill the last slot. */ |
3699 |
if (kbd_fetch_ptr - 1 != kbd_store_ptr) |
if (kbd_fetch_ptr - 1 != kbd_store_ptr) |
3700 |
{ |
{ |
3701 |
|
*kbd_store_ptr = *event; |
3702 |
|
++kbd_store_ptr; |
3703 |
|
} |
3704 |
|
} |
3705 |
|
|
|
#if 0 /* The SELECTION_REQUEST_EVENT case looks bogus, and it's error |
|
|
prone to assign individual members for other events, in case |
|
|
the input_event structure is changed. --2000-07-13, gerd. */ |
|
|
struct input_event *sp = kbd_store_ptr; |
|
|
sp->kind = event->kind; |
|
|
if (event->kind == SELECTION_REQUEST_EVENT) |
|
|
{ |
|
|
/* We must not use the ordinary copying code for this case, |
|
|
since `part' is an enum and copying it might not copy enough |
|
|
in this case. */ |
|
|
bcopy (event, (char *) sp, sizeof (*event)); |
|
|
} |
|
|
else |
|
3706 |
|
|
3707 |
{ |
/* Put an input event back in the head of the event queue. */ |
|
sp->code = event->code; |
|
|
sp->part = event->part; |
|
|
sp->frame_or_window = event->frame_or_window; |
|
|
sp->arg = event->arg; |
|
|
sp->modifiers = event->modifiers; |
|
|
sp->x = event->x; |
|
|
sp->y = event->y; |
|
|
sp->timestamp = event->timestamp; |
|
|
} |
|
|
#else |
|
|
*kbd_store_ptr = *event; |
|
|
#endif |
|
3708 |
|
|
3709 |
++kbd_store_ptr; |
void |
3710 |
|
kbd_buffer_unget_event (event) |
3711 |
|
register struct input_event *event; |
3712 |
|
{ |
3713 |
|
if (kbd_fetch_ptr == kbd_buffer) |
3714 |
|
kbd_fetch_ptr = kbd_buffer + KBD_BUFFER_SIZE; |
3715 |
|
|
3716 |
|
/* Don't let the very last slot in the buffer become full, */ |
3717 |
|
if (kbd_fetch_ptr - 1 != kbd_store_ptr) |
3718 |
|
{ |
3719 |
|
--kbd_fetch_ptr; |
3720 |
|
*kbd_fetch_ptr = *event; |
3721 |
} |
} |
3722 |
} |
} |
3723 |
|
|
3932 |
/* These two kinds of events get special handling |
/* These two kinds of events get special handling |
3933 |
and don't actually appear to the command loop. |
and don't actually appear to the command loop. |
3934 |
We return nil for them. */ |
We return nil for them. */ |
3935 |
if (event->kind == SELECTION_REQUEST_EVENT) |
if (event->kind == SELECTION_REQUEST_EVENT |
3936 |
|
|| event->kind == SELECTION_CLEAR_EVENT) |
3937 |
{ |
{ |
3938 |
#ifdef HAVE_X11 |
#ifdef HAVE_X11 |
3939 |
struct input_event copy; |
struct input_event copy; |
3944 |
copy = *event; |
copy = *event; |
3945 |
kbd_fetch_ptr = event + 1; |
kbd_fetch_ptr = event + 1; |
3946 |
input_pending = readable_events (0); |
input_pending = readable_events (0); |
3947 |
x_handle_selection_request (©); |
x_handle_selection_event (©); |
3948 |
#else |
#else |
3949 |
/* We're getting selection request events, but we don't have |
/* We're getting selection request events, but we don't have |
3950 |
a window system. */ |
a window system. */ |
3952 |
#endif |
#endif |
3953 |
} |
} |
3954 |
|
|
|
else if (event->kind == SELECTION_CLEAR_EVENT) |
|
|
{ |
|
|
#ifdef HAVE_X11 |
|
|
struct input_event copy; |
|
|
|
|
|
/* Remove it from the buffer before processing it. */ |
|
|
copy = *event; |
|
|
kbd_fetch_ptr = event + 1; |
|
|
input_pending = readable_events (0); |
|
|
x_handle_selection_clear (©); |
|
|
#else |
|
|
/* We're getting selection request events, but we don't have |
|
|
a window system. */ |
|
|
abort (); |
|
|
#endif |
|
|
} |
|
3955 |
#if defined (HAVE_X11) || defined (HAVE_NTGUI) || defined (MAC_OS) |
#if defined (HAVE_X11) || defined (HAVE_NTGUI) || defined (MAC_OS) |
3956 |
else if (event->kind == DELETE_WINDOW_EVENT) |
else if (event->kind == DELETE_WINDOW_EVENT) |
3957 |
{ |
{ |
4176 |
|
|
4177 |
/* These two kinds of events get special handling |
/* These two kinds of events get special handling |
4178 |
and don't actually appear to the command loop. */ |
and don't actually appear to the command loop. */ |
4179 |
if (event->kind == SELECTION_REQUEST_EVENT) |
if (event->kind == SELECTION_REQUEST_EVENT |
4180 |
|
|| event->kind == SELECTION_CLEAR_EVENT) |
4181 |
{ |
{ |
4182 |
#ifdef HAVE_X11 |
#ifdef HAVE_X11 |
4183 |
struct input_event copy; |
struct input_event copy; |
4188 |
copy = *event; |
copy = *event; |
4189 |
kbd_fetch_ptr = event + 1; |
kbd_fetch_ptr = event + 1; |
4190 |
input_pending = readable_events (0); |
input_pending = readable_events (0); |
4191 |
x_handle_selection_request (©); |
x_handle_selection_event (©); |
|
#else |
|
|
/* We're getting selection request events, but we don't have |
|
|
a window system. */ |
|
|
abort (); |
|
|
#endif |
|
|
} |
|
|
|
|
|
else if (event->kind == SELECTION_CLEAR_EVENT) |
|
|
{ |
|
|
#ifdef HAVE_X11 |
|
|
struct input_event copy; |
|
|
|
|
|
/* Remove it from the buffer before processing it, */ |
|
|
copy = *event; |
|
|
|
|
|
kbd_fetch_ptr = event + 1; |
|
|
input_pending = readable_events (0); |
|
|
x_handle_selection_clear (©); |
|
4192 |
#else |
#else |
4193 |
/* We're getting selection request events, but we don't have |
/* We're getting selection request events, but we don't have |
4194 |
a window system. */ |
a window system. */ |
11414 |
{ |
{ |
11415 |
if (event == kbd_buffer + KBD_BUFFER_SIZE) |
if (event == kbd_buffer + KBD_BUFFER_SIZE) |
11416 |
event = kbd_buffer; |
event = kbd_buffer; |
11417 |
if (event->kind != SELECTION_REQUEST_EVENT) |
if (event->kind != SELECTION_REQUEST_EVENT |
11418 |
|
&& event->kind != SELECTION_CLEAR_EVENT) |
11419 |
{ |
{ |
11420 |
mark_object (event->x); |
mark_object (event->x); |
11421 |
mark_object (event->y); |
mark_object (event->y); |