• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Managin mouse events in full screen
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: selector data
  • Next by Date: Re: Remove indicatorImage from table column
  • Previous by thread: [ANN] F-Script 1.3.1 Released – Scripting language for Cocoa
  • Next by thread: Authoring application Help
  • Index(es):
    • Date
    • Thread