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

  • Home
  • SEARCH
  • 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 129295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:46:07+00:00 2026-05-11T05:46:07+00:00

OK. I’m starting my first OS X application. Instead of doing something obvious or

  • 0

OK. I’m starting my first OS X application. Instead of doing something obvious or simple, I’m going straight to the system stuff.

I would like to place a caps lock indicator in the menu bar. In C# or Delphi (my primary languages) this is fairly trivial. In Mac OS X, I’m not really sure where to start. Of course I’ve downloaded Xcode and written a few little nothing style apps. Now I need to write an app that will run on start, only have a menu bar component, and work.

There’s my background. How can I get the state of the caps lock key in Cocoa?

  • 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. 2026-05-11T05:46:07+00:00Added an answer on May 11, 2026 at 5:46 am

    Run on start: Up to the user. They will put it in Login Items if they want it to run on start. You can add a button to add it to Login Items automatically; use Launch Services’ Shared File List API to add it to the Session Login Items list.

    Menu bar item: This is called a status item. See NSStatusItem.

    Checking for caps lock: First off, there may be multiple keyboards, most of which will have a caps lock, and not all of which will have the same caps lock state (the user may have one with it on, one with it off, and a third with no caps lock key at all). Pay attention to each keyboard’s caps lock state separately, and light up your indicator if any caps lock key is on.

    To read and monitor the caps lock keys, you’ll need to dip into I/O Kit. I believe you’ll need to use the HID Manager. That’s a C API, but Dave Dribin has written an Objective-C wrapper for its lower-level predecessor (most recently at 1.0.1).

    Edited to add: You can monitor caps lock using a Quartz event tap, but it’s not per-keyboard, so I’m not sure you’ll get reliable results with multiple keyboards, and it still won’t let you read the initial state of the caps lock keys when your app launches.

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

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have some data like this: 1 2 3 4 5 9 2 6
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.