summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXKeyEvent.c
diff options
context:
space:
mode:
authorculler <culler>2021-04-30 22:15:46 (GMT)
committerculler <culler>2021-04-30 22:15:46 (GMT)
commite62257d74672018ef6919a2993c67fc815ba9ab8 (patch)
tree80ed72b96540578cca5b70be7847a5d34a179c74 /macosx/tkMacOSXKeyEvent.c
parenta723a9e97cc86c5cbee7c26aca2d344ad18c12a1 (diff)
downloadtk-e62257d74672018ef6919a2993c67fc815ba9ab8.zip
tk-e62257d74672018ef6919a2993c67fc815ba9ab8.tar.gz
tk-e62257d74672018ef6919a2993c67fc815ba9ab8.tar.bz2
Fix [2ecb09d118]: Aqua ignores preferences setting to disable key repeats.
Diffstat (limited to 'macosx/tkMacOSXKeyEvent.c')
-rw-r--r--macosx/tkMacOSXKeyEvent.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c
index a46a646..cafc716 100644
--- a/macosx/tkMacOSXKeyEvent.c
+++ b/macosx/tkMacOSXKeyEvent.c
@@ -258,13 +258,15 @@ static NSUInteger textInputModifiers;
/*
* Finally we can queue the XEvent, inserting a KeyRelease before a
- * repeated KeyPress.
+ * repeated KeyPress unless key repeats have been disabled in the
+ * system preferences.
*/
if (type == NSKeyDown && [theEvent isARepeat]) {
-
- xEvent.xany.type = KeyRelease;
- Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL);
+ if ([NSEvent keyRepeatDelay] > 0) {
+ xEvent.xany.type = KeyRelease;
+ Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL);
+ }
xEvent.xany.type = KeyPress;
}
Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL);