Mercurial > emacs
comparison src/keyboard.c @ 30709:71b0b4b5d334
(kbd_buffer_events_waiting): New function.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Wed, 09 Aug 2000 12:24:02 +0000 |
parents | eed7b9be8ad3 |
children | 7a0d5d24269e |
comparison
equal
deleted
inserted
replaced
30708:7da70192ab68 | 30709:71b0b4b5d334 |
---|---|
3248 || sp->kind == scroll_bar_click) | 3248 || sp->kind == scroll_bar_click) |
3249 { | 3249 { |
3250 sp->kind = no_event; | 3250 sp->kind = no_event; |
3251 } | 3251 } |
3252 } | 3252 } |
3253 } | |
3254 | |
3255 /* Return non-zero if there are any events waiting in the event buffer | |
3256 whose .kind is not no_event. If DISCARD is non-zero, discard all | |
3257 no_event placeholders up to the first real event. If there are no | |
3258 real events waiting and DISCARD is non-zero, this function makes | |
3259 the event buffer empty as side effect. */ | |
3260 int | |
3261 kbd_buffer_events_waiting (discard) | |
3262 int discard; | |
3263 { | |
3264 struct input_event *sp; | |
3265 for (sp = kbd_fetch_ptr; sp != kbd_store_ptr; sp++) | |
3266 { | |
3267 if (sp == kbd_buffer + KBD_BUFFER_SIZE) | |
3268 sp = kbd_buffer; | |
3269 | |
3270 if (sp->kind != no_event) | |
3271 return 1; | |
3272 if (discard) | |
3273 kbd_fetch_ptr = sp; | |
3274 } | |
3275 if (discard) | |
3276 kbd_fetch_ptr = sp; | |
3277 return 0; | |
3253 } | 3278 } |
3254 | 3279 |
3255 /* Read one event from the event buffer, waiting if necessary. | 3280 /* Read one event from the event buffer, waiting if necessary. |
3256 The value is a Lisp object representing the event. | 3281 The value is a Lisp object representing the event. |
3257 The value is nil for an event that should be ignored, | 3282 The value is nil for an event that should be ignored, |