Skip to content

Instantly share code, notes, and snippets.

#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
#import <AppKit/AppKit.h>
#import <SystemConfiguration/SystemConfiguration.h>
#import <Carbon/Carbon.h>
#import <CoreFoundation/CoreFoundation.h>
static CFStringRef CopyCurrentConsoleUsername(SCDynamicStoreRef store)
{
CFStringRef result;
@thenextman
thenextman / gist:e886dfe4408c20072a88f80d2df5d60f
Created November 25, 2016 22:54 — forked from steventroughtonsmith/gist:7515380
iOS 7 UIKeyCommand keydown/keyup and keycode input implementation for a UIResponder. Private API, of course…
-(BOOL)canBecomeFirstResponder
{
return YES;
}
-(UIKeyCommand *)_keyCommandForEvent:(UIEvent *)event // UIPhysicalKeyboardEvent
{
NSLog(@"keyCommandForEvent: %@\n\
type = %i\n\
keycode = %@\n\
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Application Specific Information:
abort() called
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x918bf952 __pthread_kill + 10
Building Solution: MySolution (Debug)
Building: MyCompany.Utils (Debug|x86)
Build started 26/09/2013 2:59:18 PM.
__________________________________________________
Project "/Users/richard/Workspace/RDMOX/MySolution/MyCompany.Utils/MyCompany.Utils.csproj" (Build target(s)):
Target PrepareForBuild: