1
0
mirror of https://github.com/Swordfish90/cool-retro-term.git synced 2026-02-08 00:32:27 +00:00

Fix missing key repeats on macos.

This commit is contained in:
Filippo Scognamiglio
2025-12-13 22:55:24 +01:00
parent fed2bf21fe
commit 002c85e35f

View File

@@ -17,6 +17,10 @@
#include <fileio.h>
#include <monospacefontmanager.h>
#if defined(Q_OS_MAC)
#include <CoreFoundation/CoreFoundation.h>
#endif
QString getNamedArgument(QStringList args, QString name, QString defaultName)
{
int index = args.indexOf(name);
@@ -45,6 +49,10 @@ int main(int argc, char *argv[])
#if defined(Q_OS_MAC)
// This allows UTF-8 characters usage in OSX.
setenv("LC_CTYPE", "UTF-8", 1);
// Ensure key repeat works for letter keys (disable macOS press-and-hold for this app).
CFPreferencesSetAppValue(CFSTR("ApplePressAndHoldEnabled"), kCFBooleanFalse, kCFPreferencesCurrentApplication);
CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
#endif
if (argc>1 && (!strcmp(argv[1],"-h") || !strcmp(argv[1],"--help"))) {