summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstanton <stanton>1998-08-04 18:54:09 (GMT)
committerstanton <stanton>1998-08-04 18:54:09 (GMT)
commit02cf0e2c9f39107e16354f9c525343b56ce839fb (patch)
treef0b81ccd61505f2c8faf2508b69f8cd8d93c439f
parentaa7276196c778dc82df8be6309c5be0132d0e700 (diff)
downloadtk-02cf0e2c9f39107e16354f9c525343b56ce839fb.zip
tk-02cf0e2c9f39107e16354f9c525343b56ce839fb.tar.gz
tk-02cf0e2c9f39107e16354f9c525343b56ce839fb.tar.bz2
added WM_SYSCHAR/WM_MENUCHAR handling
-rw-r--r--win/tkWinX.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/win/tkWinX.c b/win/tkWinX.c
index 0b00186..663346c 100644
--- a/win/tkWinX.c
+++ b/win/tkWinX.c
@@ -593,6 +593,11 @@ Tk_TranslateWinEvent(hwnd, message, wParam, lParam, resultPtr)
case WM_KEYUP:
GenerateXEvent(hwnd, message, wParam, lParam);
return 1;
+ case WM_MENUCHAR:
+ GenerateXEvent(hwnd, message, wParam, lParam);
+ /* MNC_CLOSE is the only one that looks right. This is a hack. */
+ *resultPtr = MAKELONG (0, MNC_CLOSE);
+ return 1;
}
return 0;
}
@@ -893,10 +898,19 @@ GetTranslatedKey(xkey)
while (xkey->nchars < XMaxTransChars
&& PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) {
- if (msg.message == WM_CHAR) {
+ if ((msg.message == WM_CHAR) || (msg.message == WM_SYSCHAR)) {
xkey->trans_chars[xkey->nchars] = (char) msg.wParam;
xkey->nchars++;
GetMessage(&msg, NULL, 0, 0);
+
+ /*
+ * If this is a normal character message, we may need to strip
+ * off the Alt modifier (e.g. Alt-digits). Note that we don't
+ * want to do this for system messages, because those were
+ * presumably generated as an Alt-char sequence (e.g. accelerator
+ * keys).
+ */
+
if ((msg.message == WM_CHAR) && (msg.lParam & 0x20000000)) {
xkey->state = 0;
}