summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorculler <culler>2020-04-26 03:07:31 (GMT)
committerculler <culler>2020-04-26 03:07:31 (GMT)
commit551859ab46ad0d92f0097687308150befab95217 (patch)
tree34bc5093e9d7fc6f8d02e9b5749ecb8da430bc9b
parent1b713f4b0328104285771bb1ddd781feacebea38 (diff)
downloadtk-551859ab46ad0d92f0097687308150befab95217.zip
tk-551859ab46ad0d92f0097687308150befab95217.tar.gz
tk-551859ab46ad0d92f0097687308150befab95217.tar.bz2
Figured out how to make empty trans_chars, and dealt with menu and control characters.
-rw-r--r--macosx/tkMacOSXKeyEvent.c6
-rw-r--r--macosx/tkMacOSXKeyboard.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c
index 1b3d8a9..109c774 100644
--- a/macosx/tkMacOSXKeyEvent.c
+++ b/macosx/tkMacOSXKeyEvent.c
@@ -211,10 +211,12 @@ static void setXEventPoint(XEvent *xEvent, Tk_Window tkwin, NSWindow *w);
*/
setXEventPoint(&xEvent, tkwin, w);
- if (keychar < 0xF700) {
+ if ((keychar >= 0x20) && (keychar < 0xF700)) {
length = TkUniCharToUtf(keychar, xEvent.xkey.trans_chars);
+ xEvent.xkey.trans_chars[length] = 0;
+ } else {
+ xEvent.xkey.nbytes = 0;
}
- xEvent.xkey.trans_chars[length] = 0;
/*
* Finally we can queue the XEvent, inserting a KeyRelease before a
diff --git a/macosx/tkMacOSXKeyboard.c b/macosx/tkMacOSXKeyboard.c
index a628953..00b8715 100644
--- a/macosx/tkMacOSXKeyboard.c
+++ b/macosx/tkMacOSXKeyboard.c
@@ -566,10 +566,12 @@ TkpSetKeycodeAndState(
* Set trans_chars for keychars outside of the private-use range.
*/
- if (keychar < 0xF700) {
+ if ((keychar >= 0x20) && (keychar < 0xF700)) {
length = TkUniCharToUtf(keychar, eventPtr->xkey.trans_chars);
+ eventPtr->xkey.trans_chars[length] = 0;
+ } else {
+ eventPtr->xkey.nbytes = 0;
}
- eventPtr->xkey.trans_chars[length] = 0;
}
}