summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXKeyEvent.c
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2015-03-21 00:57:31 (GMT)
committerKevin Walzer <kw@codebykevin.com>2015-03-21 00:57:31 (GMT)
commitf22c4207e5275f1e2c792672b41f6828372d6203 (patch)
treeb059e6ed5fc502b421bbe15198bc90824dfba74f /macosx/tkMacOSXKeyEvent.c
parent9787a9f42d575fd80d370323e6fe37290f5609cd (diff)
downloadtk-f22c4207e5275f1e2c792672b41f6828372d6203.zip
tk-f22c4207e5275f1e2c792672b41f6828372d6203.tar.gz
tk-f22c4207e5275f1e2c792672b41f6828372d6203.tar.bz2
Cleanup and improvement of tracking of native windows in Cocoa; thanks to Marc Culler for patch
Diffstat (limited to 'macosx/tkMacOSXKeyEvent.c')
-rw-r--r--macosx/tkMacOSXKeyEvent.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c
index c9ad9f1..09cdf94 100644
--- a/macosx/tkMacOSXKeyEvent.c
+++ b/macosx/tkMacOSXKeyEvent.c
@@ -78,16 +78,18 @@ static unsigned isFunctionKey(unsigned int code);
case NSFlagsChanged:
modifiers = [theEvent modifierFlags];
keyCode = [theEvent keyCode];
- w = [self windowWithWindowNumber:[theEvent windowNumber]];
+ // w = [self windowWithWindowNumber:[theEvent windowNumber]];
+ w = [theEvent window];
#if defined(TK_MAC_DEBUG_EVENTS) || NS_KEYLOG == 1
NSLog(@"-[%@(%p) %s] r=%d mods=%u '%@' '%@' code=%u c=%d %@ %d", [self class], self, _cmd, repeat, modifiers, characters, charactersIgnoringModifiers, keyCode,([charactersIgnoringModifiers length] == 0) ? 0 : [charactersIgnoringModifiers characterAtIndex: 0], w, type);
#endif
break;
default:
- return theEvent;
+ return theEvent; /* Unrecognized key event. */
}
+ /* Create an Xevent to add to the Tk queue. */
if (!processingCompose) {
unsigned int state = 0;
@@ -128,7 +130,7 @@ static unsigned isFunctionKey(unsigned int code);
tkwin = (Tk_Window) winPtr->dispPtr->focusPtr;
if (!tkwin) {
TkMacOSXDbgMsg("tkwin == NULL");
- return theEvent;
+ return theEvent; /* Give up. No window for this event. */
}
/*