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

terminal: term_send_ucs makes its own struct term_event.

This commit is contained in:
Kalle Olavi Niemitalo 2006-08-05 13:20:22 +03:00 committed by Miciah Dashiel Butler Masters
parent e2a93ac8c3
commit 1e9f5f6743

View File

@ -127,15 +127,17 @@ term_send_event(struct terminal *term, struct term_event *ev)
} }
static void static void
term_send_ucs(struct terminal *term, struct term_event *ev, unicode_val_T u) term_send_ucs(struct terminal *term, unicode_val_T u, int modifier)
{ {
unsigned char *recoded; unsigned char *recoded;
struct term_event ev;
set_kbd_term_event(&ev, KBD_UNDEF, modifier);
recoded = u2cp_no_nbsp(u, get_opt_codepage_tree(term->spec, "charset")); recoded = u2cp_no_nbsp(u, get_opt_codepage_tree(term->spec, "charset"));
if (!recoded) recoded = "*"; if (!recoded) recoded = "*";
while (*recoded) { while (*recoded) {
ev->info.keyboard.key = *recoded; ev.info.keyboard.key = *recoded;
term_send_event(term, ev); term_send_event(term, &ev);
recoded++; recoded++;
} }
} }
@ -293,13 +295,15 @@ handle_interlink_event(struct terminal *term, struct interlink_event *ilev)
if (u < interlink->utf_8.min) if (u < interlink->utf_8.min)
u = UCS_NO_CHAR; u = UCS_NO_CHAR;
term_send_ucs(term, &tev, u); term_send_ucs(term, u,
get_kbd_modifier(&tev));
} }
break; break;
} else { } else {
interlink->utf_8.len = 0; interlink->utf_8.len = 0;
term_send_ucs(term, &tev, UCS_NO_CHAR); term_send_ucs(term, UCS_NO_CHAR,
get_kbd_modifier(&tev));
} }
} }
@ -322,7 +326,7 @@ handle_interlink_event(struct terminal *term, struct interlink_event *ilev)
break; break;
} }
term_send_ucs(term, &tev, UCS_NO_CHAR); term_send_ucs(term, UCS_NO_CHAR, get_kbd_modifier(&tev));
break; break;
} }