954,224 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Toggle caps, num or scroll lock

[FONT=Courier New]I want to toggle caps, num or scroll lock using c++ program on a unix machine. Can some one help?

mrb260478
Newbie Poster
5 posts since Aug 2004
Reputation Points: 10
Solved Threads: 0
 

Try using setleds. It comes standard on most linux boxes.
http://linux.about.com/library/cmd/blcmdl1_setleds.htm

For fun check out:
http://www.hut.fi/~jlohikos/tleds_orig.html
Blinking leds for network activity! :)

Back to your question... simply do a exec (...) to call the setleds program, or look at the sources for tleds or setled. It shouldn't be hard at all to do programatically in C++.

cosi
Junior Poster
153 posts since Aug 2004
Reputation Points: 17
Solved Threads: 1
 

Hi Cosi,

Thanks for replying.
I tried the sites mentioned by you. But they don't show the sources. I have come across a source that could toggle caps lock on and off but on a Windows/Dos operating system using POKEB or PEEKB functions including in header file DOS.H, which is not helpful, as I have to run the program on a Unix (SCO Unixware) Operating system on which dos.h cannot be run. Can you or any one suggest what functions are available on Unix Operating system like POKEB or PEEKB on Windows/Dos operating system. :p

mrb260478
Newbie Poster
5 posts since Aug 2004
Reputation Points: 10
Solved Threads: 0
 

Uhh.. I clearly see that tleds has source code on their website. Check again. At any rate, you may do an exec C function to call the program setleds. This will also work.

Ed

cosi
Junior Poster
153 posts since Aug 2004
Reputation Points: 17
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You