summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXKeyEvent.c
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2018-08-13 02:20:03 (GMT)
committerKevin Walzer <kw@codebykevin.com>2018-08-13 02:20:03 (GMT)
commit14fd1caef84a4b9f4470d4191290df611993a37e (patch)
tree2f9931ef9d358eb170a4a56bff6537cb8e0036d7 /macosx/tkMacOSXKeyEvent.c
parent9a42d409833f2933aeb2d05ec0ed1905bdd0ebb0 (diff)
downloadtk-14fd1caef84a4b9f4470d4191290df611993a37e.zip
tk-14fd1caef84a4b9f4470d4191290df611993a37e.tar.gz
tk-14fd1caef84a4b9f4470d4191290df611993a37e.tar.bz2
Clean up, remove commented-out code
Diffstat (limited to 'macosx/tkMacOSXKeyEvent.c')
-rw-r--r--macosx/tkMacOSXKeyEvent.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c
index fc56ede..1068922 100644
--- a/macosx/tkMacOSXKeyEvent.c
+++ b/macosx/tkMacOSXKeyEvent.c
@@ -42,7 +42,6 @@ static void setupXEvent(XEvent *xEvent, NSWindow *w, unsigned int state);
static unsigned isFunctionKey(unsigned int code);
unsigned short releaseCode;
-NSString *releaseChar;
#pragma mark TKApplication(TKKeyEvent)
@@ -72,7 +71,7 @@ NSString *releaseChar;
switch (type) {
case NSKeyUp:
- //fix for 1ba71a86bb: key release firing on key press
+ /*Fix for bug #1ba71a86bb: key release firing on key press.*/
w = [theEvent window];
XEvent xEvent;
setupXEvent(&xEvent, w, 0);
@@ -262,22 +261,17 @@ NSString *releaseChar;
xEvent.xany.type = KeyPress;
for (i =0; i<len; i++)
- {
- xEvent.xkey.keycode = (UInt16) [aString characterAtIndex: i];
- [[aString substringWithRange: NSMakeRange(i,1)]
- getCString: xEvent.xkey.trans_chars
- maxLength: XMaxTransChars encoding: NSUTF8StringEncoding];
- xEvent.xkey.nbytes = strlen(xEvent.xkey.trans_chars);
- xEvent.xany.type = KeyPress;
- releaseCode = (UInt16) [aString characterAtIndex: 0];
- Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL);
-
- // xEvent.xany.type = KeyRelease;
- // xEvent.xany.serial = LastKnownRequestProcessed(Tk_Display(tkwin));
- // Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL);
- // xEvent.xany.serial = LastKnownRequestProcessed(Tk_Display(tkwin));
- }
- releaseCode = (UInt16) [aString characterAtIndex: 0];
+ {
+ xEvent.xkey.keycode = (UInt16) [aString characterAtIndex: i];
+ [[aString substringWithRange: NSMakeRange(i,1)]
+ getCString: xEvent.xkey.trans_chars
+ maxLength: XMaxTransChars encoding: NSUTF8StringEncoding];
+ xEvent.xkey.nbytes = strlen(xEvent.xkey.trans_chars);
+ xEvent.xany.type = KeyPress;
+ releaseCode = (UInt16) [aString characterAtIndex: 0];
+ Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL);
+ }
+ releaseCode = (UInt16) [aString characterAtIndex: 0];
}