I have recently noticed something rather annoying, when in console (in one of the TTYs), if I press the caps lock key, the little light which normally lights up to show me that it is, does not, nor does the little light that tells me if my num lock is. Now this is rather annoying because sometimes I am typing something like a password which contains capital letters, and I can't actually see if the caps lock is on or not...

So I was wondering if there is a way to get them to show? And why they are not showing anyway (as they do when in the normal desktop environment)? As the light which shows my disk activity, is working fine, and it is just next to those other lights on my keyboard.

OS Information:

Description:    Ubuntu 15.04
Release:    15.04
  • I think usually cap, num etc locks are handled by the X server, which does not work on TTYs (e.g. see the answers here - all I think are for GUI only)) – Wilf Jul 5 '15 at 14:50
  • @Wilf: So there is no way to get them to work in the TTYs? – user364819 Jul 5 '15 at 14:52
  • @Wilf actually they do work in the TTY's, at least for me. The only thing is that the LED state is not updated when switching between Xorg and TTY, yet the LED's on my laptop are toggled by pressing the buttons no matter where you are. – s3lph Jul 5 '15 at 14:56
  • I know caps lock etc work in ttys, but is probably some low level thing that does not change the led status – Wilf Jul 5 '15 at 14:58
  • @Wilf: So how could you find and change that low level thing which would make them change? Or which package should I suggest this to? – user364819 Jul 5 '15 at 15:02

This might comes with some strings attached on how it work (with GNOME 3 running in a another TTY, the indicator lights got confused), but setleds seemed to work for me (in a TTY console, not in a terminal):

$ setleds
Current default flags:  NumLock off   CapsLock off   ScrollLock off
Current flags:          NumLock off   CapsLock off   ScrollLock off
Current leds:           NumLock off   CapsLock off   ScrollLock off

Which no arguments is shows the current status of the keys.
You can also change the status of the caps lock etc with

setleds -D -caps
setleds -D +caps

For more info readman setleds

  • Ok, I ran that before, and after I turned the caps and num lock on, and they still all say off, so I'm not really too sure how this helps me... Or how I could use this to fix my problem... – user364819 Jul 5 '15 at 15:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy