cocoa: Add SDL_HINT_MAC_PRESS_AND_HOLD hint

This commit is contained in:
Ethan Lee committed 2025-12-02 10:24:39 -05:00
1 parent 6217672bde
commit dedab7b72c
2 files changed
+17 -1

No files matched your search

+2 -1
View File
@@ -105,10 +105,11 @@ static void Cocoa_DispatchEvent(NSEvent *theEvent)
+ (void)registerUserDefaults
{
BOOL momentumScrollSupported = (BOOL)SDL_GetHintBoolean(SDL_HINT_MAC_SCROLL_MOMENTUM, false);
BOOL pressAndHoldEnabled = (BOOL)SDL_GetHintBoolean(SDL_HINT_MAC_PRESS_AND_HOLD, true);
NSDictionary *appDefaults = [[NSDictionary alloc] initWithObjectsAndKeys:
[NSNumber numberWithBool:momentumScrollSupported], @"AppleMomentumScrollSupported",
[NSNumber numberWithBool:YES], @"ApplePressAndHoldEnabled",
[NSNumber numberWithBool:pressAndHoldEnabled], @"ApplePressAndHoldEnabled",
[NSNumber numberWithBool:YES], @"ApplePersistenceIgnoreState",
nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults];