마우스 이동 이벤트를 받으려면 NSTrackingArea를 전체 화면보기에 설치하려고합니다.NSTrackingArea 전체 화면 창 /보기
그러나 내가 할 때마다 나는 어설 션 오류가 발생합니다. 웹을 검색했지만 리드를 찾을 수 없었습니다.
가cocoaWindow = [[NSWindow alloc] initWithContentRect:NSMakeRect(0.0, 0.0, x,y)
styleMask: NSTitledWindowMask
backing: NSBackingStoreBuffered
defer:NO];
glView = [[WLMacGLView alloc] initWithFrame:NSMakeRect(0.0, 0.0, x,y) pixelFormat:[WLMacGLView defaultPixelFormat]];
[glView setCocoaController:self];
//add the glView as a subview of the window's content view
[[cocoaWindow contentView] addSubview:glView];
NSRect r = [glView frame];
NSTrackingArea *track = [[NSTrackingArea alloc] initWithRect:r options: NSTrackingMouseMoved | NSTrackingActiveWhenFirstResponder | NSTrackingActiveInKeyWindow
owner:self userInfo:nil];
[glView addTrackingArea:track];
[glView enterFullScreenMode:[NSScreen mainScreen] withOptions:nil];
[glView createContext];
어설 바로 enterFullScreenMode 호출 후 발생 : withOptions :
사람 여기
*** Assertion failure in -[_NSFullScreenWindow _setTrackingRect:inside:owner:userData:useTrackingNum:install:], /SourceCache/AppKit/AppKit-1038.25/AppKit.subproj/NSWindow.m:3944
는 (Y, X = 1024 = 768) 추적 영역을 설정하는 코드의 아이디어 있어요? 전체 화면 창에서 마우스 이동 이벤트를 얻기 위해 취해야하는 접근 방식이 아닙니까?
이러한 메서드는 구현되지만 창이 전체 화면 일 때 호출되지 않습니다. – wadesworld
http://developer.apple.com/mac/library/samplecode/GeekGameBoard/index.html (OpenGL이 아닌 NSView 서브 클래스를 사용함)에서 살펴볼 수있는 샘플 응용 프로그램이 있습니다. –
'-mouseMoved :'를 사용하려면'[[glView window] setAcceptsMouseMovedEvents : YES]'를 호출해야합니다. –