summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXKeyEvent.c
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2015-03-21 00:57:14 (GMT)
committerKevin Walzer <kw@codebykevin.com>2015-03-21 00:57:14 (GMT)
commit4f6c1ad7943f8c595d9d539a6c6c33c96832554b (patch)
tree28a13f3c5fdd1724d3f1e4cce22305e2c775a2bd /macosx/tkMacOSXKeyEvent.c
parentc76fcabd431431b1acfc9d4113781872fcc9fe9b (diff)
downloadtk-4f6c1ad7943f8c595d9d539a6c6c33c96832554b.zip
tk-4f6c1ad7943f8c595d9d539a6c6c33c96832554b.tar.gz
tk-4f6c1ad7943f8c595d9d539a6c6c33c96832554b.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. */
}
/*