I'm using a Macbook pro early 2015 with Debian and Xfce, and I wanted to have the same behaviour as on OSX, that is to say have the numbers be displayed when the caps lock key is on. I don't have a numerical pad on my laptop, so this is pretty tedious to have to press the shift key every time I want to type a number. So, to solve this problem, I used:


in my /etc/default/keyboard file in order to have this setting apply on startup. However, the problem is that this behaves as if I had shift on all the time and thus applies to the whole keyboard, so if caps lock is on, I can't for example alt-tab normally etc...

How can I do it so that caps lock applies to numbers only, and not to other parts of the keyboard?

I have already tried:


But it doesn't work as expected...

For additional information, here is my basic /etc/default/keyboard file:


For those not familiar with the French AZERTY layout, it is the one language layout that requires Shift to be pressed to access the numeric keys.

Thanks in advance for any help, and sorry if my explanations are not perfect, I'm very new to Debian/GNU Linux (and new here), so don't hesitate to tell me of any element I may have missed. : )

  • Do you use a French layout with AZERTY? The only language that doesn't just have numbers initially exposed without shift is French. All other languages, the numbers are right there.
    – Tetsujin
    Jul 29, 2022 at 17:57
  • 1
    Yes I do, I have added all the information regarding the file, sorry for omitting that, and thanks for pointing it out. : ) Jul 29, 2022 at 18:03
  • Thanks. I thought it worth mentioning, for those confused by your need to press shift for numbers. idk how to fix it for nix, sorry. For Mac, Ukelele would be your go-to. I added a further explanation in your question for those totally unfamiliar with this AZERTY peculiarity, so people don't wonder why it happens. I wish you luck :)
    – Tetsujin
    Jul 29, 2022 at 18:04
  • 1
    Thanks a lot for your kindness and help with the wording of the problem! <3 Jul 29, 2022 at 18:09

1 Answer 1


Problem: Caps Lock not working for upper row numbers on a French keyboard Layout.

Solution: Set the xkbmap option caps to caps:shiftlock with the command:

setxkbmap -option caps:shiftlock Hope it works!

  • It works, but it also removes the possibility to use accented letters, which is not ideal... But as a temporary solution, why not! : ) Dec 8, 2022 at 7:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .