How do I make Fn key work like toggle and Caps Lock sticky?

Currently, I want these two specific keys but I prefer a general solution to the problem.

  • Isn't that the standard behaviour? – Fabby Dec 19 '14 at 0:57
  • 1
    I need to hold Fn to get special functions on F1-F12 keys and I use special layout so Caps Lock has different function than normaly – curusarn Dec 19 '14 at 19:38
  • Changing Fn may not possible only if the its manufacturer added such option to BIOS.

    Short answer: Pressing Fn alone does not send a scancode.
    Long answer: See How do Fn keys work?

  • Stiky key for Caps lock alone (not full accessibility sticky modifiers)

    1. Change Caps lock key interpretation

      sudo nano /usr/share/X11/xkb/compat/caps

      Change LockMods action to LatchMods

      partial xkb_compatibility "caps_lock"  {
          // Keysym Caps_Lock locks Lock modifier.
          // With this, the keysym Caps_Lock can be used without binding the whole
          // key to a real modifier.
              // This is essential when you don't want to use caps lock on the first
              // level.
              // This should not have any compatibility issues when used together with
              // other layouts which don't utilize this capability.
          interpret Caps_Lock {
              action = LatchMods(modifiers = Lock);
    2. Compile the change & update the initramfs images

      sudo dpkg-reconfigure xkb-data
      sudo update-initramfs -u -k all
    3. Reboot

    Note, I still don't know how to make keyboard led follow the state.

    To make toggle for other modifiers (ex Alt) change their SetMods action to LockMods. Most virtual modifiers are handled in compat/misc file.

    For references see my answer to other similar question: Letting modifier keys act as toggles under X

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.