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:
@@ -17,6 +17,10 @@
|
|||||||
#include <fileio.h>
|
#include <fileio.h>
|
||||||
#include <monospacefontmanager.h>
|
#include <monospacefontmanager.h>
|
||||||
|
|
||||||
|
#if defined(Q_OS_MAC)
|
||||||
|
#include <CoreFoundation/CoreFoundation.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
QString getNamedArgument(QStringList args, QString name, QString defaultName)
|
QString getNamedArgument(QStringList args, QString name, QString defaultName)
|
||||||
{
|
{
|
||||||
int index = args.indexOf(name);
|
int index = args.indexOf(name);
|
||||||
@@ -45,6 +49,10 @@ int main(int argc, char *argv[])
|
|||||||
#if defined(Q_OS_MAC)
|
#if defined(Q_OS_MAC)
|
||||||
// This allows UTF-8 characters usage in OSX.
|
// This allows UTF-8 characters usage in OSX.
|
||||||
setenv("LC_CTYPE", "UTF-8", 1);
|
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
|
#endif
|
||||||
|
|
||||||
if (argc>1 && (!strcmp(argv[1],"-h") || !strcmp(argv[1],"--help"))) {
|
if (argc>1 && (!strcmp(argv[1],"-h") || !strcmp(argv[1],"--help"))) {
|
||||||
|
|||||||
Reference in New Issue
Block a user