/* Copyright (C) 2001 by Alex Kompel */
/* NetHack may be freely redistributed. See license for details. */
+/* JNetHack Copyright */
+/* (c) Issei Numata, Naoki Hamada, Shigehiro Miyashita, 1994-2000 */
+/* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2016 */
+/* JNetHack may be freely redistributed. See license for details. */
+
#include "winMS.h"
#include <commdlg.h>
#include "date.h"
MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PNHMainWindow data;
+#if 1 /*JP*/
+ static int doublebyte = 0;
+#endif
switch (message) {
case WM_CREATE:
} /* end switch */
} break;
+#if 1 /*JP*//*\91S\8ap\95¶\8e\9a\91Î\89\9e*/
+ case WM_CHAR:
+ {
+ if (doublebyte == 1) {
+ NHEVENT_KBD(wParam & 0xFF);
+ doublebyte = 0;
+ return 0;
+ } else if (is_kanji(wParam)) {
+ NHEVENT_KBD(wParam & 0xFF);
+ doublebyte = 1;
+ return 0;
+ }
+ } break;
+
+#endif
case WM_SYSCHAR: /* Alt-char pressed */
{
/*
/* Copyright (C) 2001 by Alex Kompel */
/* NetHack may be freely redistributed. See license for details. */
+/* JNetHack Copyright */
+/* For 3.6-, Copyright (c) SHIRAKATA Kentaro, 2016 */
+/* JNetHack may be freely redistributed. See license for details. */
+
/*
* This file implements the interface between the window port specific
* code in the mswin port and the rest of the nethack game engine.
logDebug("mswin_getlin(%s, %p)\n", question, input);
if (!iflags.wc_popup_dialog) {
+#if 0 /*JP*/
char c;
+#else
+ int c;
+#endif
int len;
int done;
int createcaret;
if (c == VK_BACK) {
if (len > 0)
len--;
+#if 1 /*JP*//*2\83o\83C\83g\95¶\8e\9a\82È\82ç\82à\82¤1\83o\83C\83g\8fÁ\82·*/
+ if (len > 0 && is_kanji2(input, len))
+ len--;
+#endif
input[len] = '\0';
} else if (len>=(BUFSZ-1)) {
PlaySound((LPCSTR)SND_ALIAS_SYSTEMEXCLAMATION, NULL, SND_ALIAS_ID|SND_ASYNC);
} else {
input[len++] = c;
+#if 1 /*JP*//*2\83o\83C\83g\95¶\8e\9a\82È\82ç\82»\82Ì\8fê\82Å\82à\82¤1\83o\83C\83g\93Ç\82Ý\8d\9e\82Þ*/
+ if (is_kanji(c)){
+ c = mswin_nhgetch();
+ input[len++] = c;
+ }
+#endif
input[len] = '\0';
}
mswin_putstr_ex(WIN_MESSAGE, ATR_NONE, input, 1);