Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4004816
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:19:10+00:00 2026-05-20T08:19:10+00:00

I have a NSWindow that I’m putting into fullscreen mode. I would like to

  • 0

I have a NSWindow that I’m putting into fullscreen mode. I would like to be able to hide the mouse when its not in use (say 15 seconds after it was last used). I have my application delegate as follows:

MyMediaRoomAppDelegate.h:

#import <Cocoa/Cocoa.h>

@interface MyMediaRoomAppDelegate : NSResponder <NSApplicationDelegate> {
    NSWindow *window;
    NSDate *lastMouseMove;
}

@property (assign) IBOutlet NSWindow *window;
@property (nonatomic, retain) NSDate *lastMouseMove;

@end

MyMediaRoomAppDelegate.m:

#import "MyMediaRoomAppDelegate.h"

@implementation MyMediaRoomAppDelegate

@synthesize window;
@synthesize lastMouseMove;

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    // The application has just finished lanching

    // Grab the screen size
    NSRect screenRect;
    screenRect = [[NSScreen mainScreen] frame];

    // Setup the window - full screen
    [[self window] setLevel:NSMainMenuWindowLevel+1];
    [[self window] setStyleMask:NSBorderlessWindowMask];
    [[self window] setOpaque:YES];
    [[self window] setBackgroundColor:[NSColor blackColor]];
    [[self window] setFrame:screenRect display:YES animate:NO];

    // Setup the mouse
    [[self window] setAcceptsMouseMovedEvents:YES];
    [[self window] makeFirstResponder:self];
    [NSCursor hide];
}

- (BOOL)acceptsFirstResponder
{
    return YES;
}

- (void)mouseMoved:(NSEvent *)theEvent
{
    [NSCursor unhide];
    [self setLastMouseMove: [NSDate date]];
}

@end

What I’m not sure about is how to re-hide the cursor after 15 seconds. The thing is I need to check setLastMouseMove, every second or so, not just call [NSCursor hide] after 15 seconds is up.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T08:19:10+00:00Added an answer on May 20, 2026 at 8:19 am

    Try NSTimer. You can specify it to be repeating at creation time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So right now I have an NSWindow that draws itself like an NSToolbar using
lets say I have an NSWindow Class, that has several events for mouse and
I am writing a status item app that does not have an NSWindow. I
I have an instance of NSWindow that I resize programatically (with setFrame). At its
I have a NSWindow that hosts a WebView that Ive hooked up to a
I have an NSWindow that shows up when you click either of two items
I have an NSWindow containing and NSImageView. I want that the user can drag
In my application, I have a NSWindow that has a NSTableView object and a
I have a borderless NSWindow subclass that I use as part of a document
I have a custom NSWindow subclass that the user can toggle the display of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.