Managin mouse events in full screen
Managin mouse events in full screen
- Subject: Managin mouse events in full screen
- From: Lorenzo <email@hidden>
- Date: Mon, 06 Feb 2006 17:26:32 +0100
Hi,
I am trying to detect and dispatch mouse events when my app runs in full
screen. The animation runs well, but everything I do with the mouse, e.g.
drag, click... gives me jerky results. This never happened when I used to go
full screen using a window. Now I am using the suggested and faster method
[fullScreenContext setFullScreen];
Then I call the method below firing a timer with 0.005 interval,
NSEventTrackingRunLoopMode and NSModalPanelRunLoopMode.
What am I doing wrong?
- (void)updateFullScreen
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSEvent *event = [NSApp currentEvent];
// Also I checked the following, but same bad results
// [NSApp nextEventMatchingMask:NSAnyEventMask
// untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode
// dequeue:YES];
switch([event type]){
case NSLeftMouseDown:
[evMan mouseDown:event];
break;
case NSLeftMouseUp:
[evMan mouseUp:event];
break;
case NSLeftMouseDragged:
[evMan mouseDragged:event];
break;
case NSKeyDown:
if([event keyCode] == kKeyCodeEscape) [self goWindowScreen];
else [evMan keyDown:event];
break;
default:
break;
}
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glViewport(0, 0, width, height);
[engine drawAllObjects];
[fullScreenContext flushBuffer];
// Clean up any autoreleased objects
[pool release];
}
Best Regards
--
Lorenzo
email: email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden