mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 21:14:35 +00:00
Cocoa: Move to modern Objective-C literals
This commit is contained in:
parent
c3ed70a4b7
commit
17a15a20f2
@ -657,7 +657,7 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
|
|||||||
|
|
||||||
_glfwInputKey(window, key, [event keyCode], GLFW_PRESS, mods);
|
_glfwInputKey(window, key, [event keyCode], GLFW_PRESS, mods);
|
||||||
|
|
||||||
[self interpretKeyEvents:[NSArray arrayWithObject:event]];
|
[self interpretKeyEvents:@[event]];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)flagsChanged:(NSEvent *)event
|
- (void)flagsChanged:(NSEvent *)event
|
||||||
@ -1005,10 +1005,7 @@ static GLFWbool initializeAppKit(void)
|
|||||||
[NSApp run];
|
[NSApp run];
|
||||||
|
|
||||||
// Press and Hold prevents some keys from emitting repeated characters
|
// Press and Hold prevents some keys from emitting repeated characters
|
||||||
NSDictionary* defaults =
|
NSDictionary* defaults = @{@"ApplePressAndHoldEnabled":@NO};
|
||||||
[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:NO],
|
|
||||||
@"ApplePressAndHoldEnabled",
|
|
||||||
nil];
|
|
||||||
[[NSUserDefaults standardUserDefaults] registerDefaults:defaults];
|
[[NSUserDefaults standardUserDefaults] registerDefaults:defaults];
|
||||||
|
|
||||||
return GLFW_TRUE;
|
return GLFW_TRUE;
|
||||||
@ -1731,10 +1728,8 @@ void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor)
|
|||||||
|
|
||||||
void _glfwPlatformSetClipboardString(const char* string)
|
void _glfwPlatformSetClipboardString(const char* string)
|
||||||
{
|
{
|
||||||
NSArray* types = [NSArray arrayWithObjects:NSPasteboardTypeString, nil];
|
|
||||||
|
|
||||||
NSPasteboard* pasteboard = [NSPasteboard generalPasteboard];
|
NSPasteboard* pasteboard = [NSPasteboard generalPasteboard];
|
||||||
[pasteboard declareTypes:types owner:nil];
|
[pasteboard declareTypes:@[NSPasteboardTypeString] owner:nil];
|
||||||
[pasteboard setString:[NSString stringWithUTF8String:string]
|
[pasteboard setString:[NSString stringWithUTF8String:string]
|
||||||
forType:NSPasteboardTypeString];
|
forType:NSPasteboardTypeString];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user