tags:

views:

55

answers:

2

Hello All,

I want to Send my machine an hardware event so that my caps-lock key becomes enable. When I send enable interrupt, light on Caps-lock key should be on and when I send enable interrupt, light on Caps-lock key should be off.

I am using Qt, Mac, C++, Carbon.

Any help is appreciated.

Thanks, Rahul

A: 

Can you even generate a HW interrupt from a non-privileged userspace application on OS X. It sound to me as if this is something that you should request the OS to do (i.e. turn on or off Caps Lock)

e8johan
+1  A: 

No need for an interrupt. The Caps Lock, Num Lock, and Scroll Lock lights are programmatically controllable.

Note that this won't actually turn the Caps Lock on (causing the user to enter all-capital text), but you shouldn't do that. If you need text input to be in a specific format, then you should make any needed repairs to it—which may include capitalizing it—yourself.

Peter Hosey
Thank you so much for this code. I've been looking for a way to turn on/off caps lock light on OS-X for several days already. Of course it would be even better if I could not just turn on/off the light, but really turn on/off caps-lock (just turning on the light won't make letters upper-case). Do you also know a code sample how this can be done?
Mecki
Mecki: See what I said in my answer.
Peter Hosey