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 8804291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:33:53+00:00 2026-06-14T01:33:53+00:00

I have started listening to global keyDown events. Is there a way to get

  • 0

I have started listening to global keyDown events. Is there a way to get information from which application that event came?

A handler receives NSNotification instance and NSEvent is part of it. Can I somehow extract that information from those objects?

Listening snippet:

[NSEvent addGlobalMonitorForEventsMatchingMask:NSKeyDownMask handler:^(NSEvent *event){
    NSLog(@"global keyDown %@", event);
    [[NSNotificationCenter defaultCenter] postNotificationName:kKeyPressed
                                                        object:event];

}];

Observer:

[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(keyEventHandler:)
                                             name:kKeyPressed
                                           object:nil];

UPDATE

Global key downs are not send from any particular application. What I actually needed is to check for currently active application at event handler:

[[NSWorkspace sharedWorkspace] activeApplication]

This returns NSDictionary with information I needed.

  • 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-06-14T01:33:54+00:00Added an answer on June 14, 2026 at 1:33 am

    You’re not posting a distributed notification, or using a distributed notification center. This means you know that the notification came from the current application.

    Meanwhile, you’re generating the notifications yourself, so if you did need to know the application, you could just add that in.

    Finally, the events you’re embedding are global key events, which do not have an associated application. Except in special cases, they’re not generated by any application, they’re generated by the user typing on the keyboard.

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

Sidebar

Related Questions

I have started implementing Subscriptions into my app but I cannot get the API
Currently we have a Jetty 7 server started this way //create a new server
I'm trying to get a value from a netcat connection started at a php
I have a C# application that uses a Windows service that is not always
I have a multiprocessing application that leaks memory. However, the leak is not in
I have developed a Java socket server connection which is working fine. When started
I have started to look into python and am trying to grasp new things
I have started to try out to use the new Search API, the demo
I have started developing for Adroid Phones a couple of days ago and I
I have started using WSO2 Stratos live and started using WSO2 data services server.

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.