diff options
author | culler <culler> | 2021-05-01 19:05:14 (GMT) |
---|---|---|
committer | culler <culler> | 2021-05-01 19:05:14 (GMT) |
commit | 3f47ae784d247155e4d13cba516fb223b138d5c3 (patch) | |
tree | 2d79414d5978faa2e58ed5611380560bfc3478a4 /macosx | |
parent | e62257d74672018ef6919a2993c67fc815ba9ab8 (diff) | |
download | tk-3f47ae784d247155e4d13cba516fb223b138d5c3.zip tk-3f47ae784d247155e4d13cba516fb223b138d5c3.tar.gz tk-3f47ae784d247155e4d13cba516fb223b138d5c3.tar.bz2 |
Completely ignore repeat events if the repeat interval is set to off. How does this affect the TextInputClient?
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXKeyEvent.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index cafc716..160a23e 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -217,9 +217,14 @@ static NSUInteger textInputModifiers; /* * We are not handling this event as an NSTextInputClient, so we need to - * finish constructing the XEvent and queue it. + * finish constructing the XEvent and queue it. However, we just drop all + * repeated events in the case that the user has turned off key repeats. + * See ticket [2ecb09d118]. */ + if ([theEvent isARepeat] && [NSEvent keyRepeatDelay] < 0) { + return theEvent; + } macKC.v.o_s = ((modifiers & NSShiftKeyMask ? INDEX_SHIFT : 0) | (modifiers & NSAlternateKeyMask ? INDEX_OPTION : 0)); macKC.v.virt = virt; @@ -263,10 +268,8 @@ static NSUInteger textInputModifiers; */ if (type == NSKeyDown && [theEvent isARepeat]) { - if ([NSEvent keyRepeatDelay] > 0) { - xEvent.xany.type = KeyRelease; - Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL); - } + xEvent.xany.type = KeyRelease; + Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL); xEvent.xany.type = KeyPress; } Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL); |