From 93789396b16e0eaef7b0d540b2ff2a39b5a315ec Mon Sep 17 00:00:00 2001 From: Manuel Argüelles Date: Wed, 21 Aug 2013 16:19:35 -0500 Subject: Add wide char support in toxic (issue #440) Set current locale, use of get_wch instead of getch for reading, use wctomb and friends to convert back from wchar_t, link with cursesw. Unicode support is only added to chat windows. --- testing/toxic/windows.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'testing/toxic/windows.c') diff --git a/testing/toxic/windows.c b/testing/toxic/windows.c index 8fdf4e19..f50bdc2d 100644 --- a/testing/toxic/windows.c +++ b/testing/toxic/windows.c @@ -226,16 +226,18 @@ void draw_active_window(Messenger *m) { ToxWindow *a = active_window; + wint_t ch = 0; + prepare_window(a->window); a->blink = false; draw_bar(); a->onDraw(a, m); /* Handle input */ - int ch = getch(); + get_wch(&ch); if (ch == '\t' || ch == KEY_BTAB) - set_next_window(ch); + set_next_window((int) ch); else if (ch != ERR) a->onKey(a, m, ch); } -- cgit v1.2.3