Search

Enabling capslock from command line

setleds : Command to set the keyboard leds like capslock, numlock etc.

If you want to turn on the "capslock" or the "numlock" from the command line you can use this command.
For eg to turn on the caps lock run the following
Note: You will have to be in text mode to run the command,it does not run in graphics mode 

$ setleds +caps  


You should see the capslock led turn on and any thing you type will be in capital. You can turn the capital off by using the caps lock key on the keyboard but the led of caps lock will continue to glow.

To turn the led off run

$ setleds -caps

The same is valid for num lock using the keyword "num" and for scroll lock using the keyword "scroll".

9 comments:

  1. Excellent Info!I got goog knowledge about this posting,Really great pleasure to reading this posting.I bookmarked this.
    Sounds like you had a great time with great people. That’s the way to live!Thanks for the info, too.
    dedicated hosting reviews

    ReplyDelete
  2. WHAT ABOUT TURNING CAPS STATUS O I CAN TYPE IN SMALL LETTERS?


    TURNING JUST LEDS IS USELESS :/

    ReplyDelete
    Replies
    1. It does not just turn the leds, it actually turns caps lock on/off

      Delete
  3. I get:
    KDGKBLED: Invalid argument
    Error reading current flags setting. Maybe you are not on the console?

    ReplyDelete
    Replies
    1. OIC, console as in tty1, etc. The problem is that when I switch back to tty7, caps is still locked on.

      Delete
    2. Yes the console means the other text mode logins,
      The capslock does not stay on tty7 for me, which distro are you using ?

      Delete
    3. I'm using Kubuntu.

      Delete
    4. I have tries it on ubuntu and debian, both gnome based, not sure if the behavior changes in kubuntu. Will try to verify

      Delete
    5. I can't imagine that Kubuntu would differ so much from vanilla Ubuntu either. I had to uninstall ibus at one stage to get my compose key working in all applications. I'm not sure if it relates to that.

      Delete