static void init_fonts(int, int);
static void another_font(int);
static void deinit_fonts(void);
+static void set_input_locale(HKL);
/* Window layout information */
static void reset_window(int);
char msg[1024], *title;
char *realhost;
- error = back->init(cfg.host, cfg.port, &realhost);
+ error = back->init(cfg.host, cfg.port, &realhost, cfg.tcp_nodelay);
if (error) {
sprintf(msg, "Unable to open connection to\n"
"%.800s\n" "%s", cfg.host, error);
}
/*
+ * Set up the initial input locale.
+ */
+ set_input_locale(GetKeyboardLayout(0));
+
+ /*
* Finally show the window!
*/
ShowWindow(hwnd, show);
}
}
+static void set_input_locale(HKL kl)
+{
+ char lbuf[20];
+
+ GetLocaleInfo(LOWORD(kl), LOCALE_IDEFAULTANSICODEPAGE,
+ lbuf, sizeof(lbuf));
+
+ kbd_codepage = atoi(lbuf);
+}
+
static void click(Mouse_Button b, int x, int y, int shift, int ctrl, int alt)
{
int thistime = GetMessageTime();
net_pending_errors();
return 0;
case WM_INPUTLANGCHANGE:
- {
- /* wParam == Font number */
- /* lParam == Locale */
- char lbuf[20];
- HKL NewInputLocale = (HKL) lParam;
-
- // lParam == GetKeyboardLayout(0);
-
- GetLocaleInfo(LOWORD(NewInputLocale),
- LOCALE_IDEFAULTANSICODEPAGE, lbuf, sizeof(lbuf));
-
- kbd_codepage = atoi(lbuf);
- }
+ /* wParam == Font number */
+ /* lParam == Locale */
+ set_input_locale((HKL)lParam);
break;
case WM_IME_NOTIFY:
if(wParam == IMN_SETOPENSTATUS) {