1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

terminal: Move kbd_timeout below set_kbd_event.

This ought to make the diff of the next commit more readable.
This commit is contained in:
Kalle Olavi Niemitalo 2006-07-28 15:49:51 +03:00 committed by Miciah Dashiel Butler Masters
parent 539f756438
commit fbd84630ac

View File

@ -621,32 +621,6 @@ free_and_return:
}
static void
kbd_timeout(struct itrm *itrm)
{
struct term_event ev;
itrm->timer = TIMER_ID_UNDEF;
assertm(itrm->in.queue.len, "timeout on empty queue");
assert(!itrm->blocked); /* block_itrm should have killed itrm->timer */
if_assert_failed return;
if (can_read(itrm->in.std)) {
in_kbd(itrm);
return;
}
set_kbd_term_event(&ev, KBD_ESC, KBD_MOD_NONE);
itrm_queue_event(itrm, (char *) &ev, sizeof(ev));
if (--itrm->in.queue.len)
memmove(itrm->in.queue.data, itrm->in.queue.data + 1, itrm->in.queue.len);
while (process_queue(itrm));
}
/* Returns the length of the escape sequence */
static inline int
get_esc_code(unsigned char *str, int len, unsigned char *code, int *num)
@ -836,6 +810,31 @@ set_kbd_event(struct term_event *ev, int key, int modifier)
set_kbd_term_event(ev, key, modifier);
}
static void
kbd_timeout(struct itrm *itrm)
{
struct term_event ev;
itrm->timer = TIMER_ID_UNDEF;
assertm(itrm->in.queue.len, "timeout on empty queue");
assert(!itrm->blocked); /* block_itrm should have killed itrm->timer */
if_assert_failed return;
if (can_read(itrm->in.std)) {
in_kbd(itrm);
return;
}
set_kbd_term_event(&ev, KBD_ESC, KBD_MOD_NONE);
itrm_queue_event(itrm, (char *) &ev, sizeof(ev));
if (--itrm->in.queue.len)
memmove(itrm->in.queue.data, itrm->in.queue.data + 1, itrm->in.queue.len);
while (process_queue(itrm));
}
/* I feeeeeel the neeeed ... to rewrite this ... --pasky */
/* Just Do it ! --Zas */
/* Parse one event from itrm->in.queue and append to itrm->out.queue.