Linux: Setup Shift Lock Key

By Xah Lee. Date: . Last updated: .

This page shows you how to setup the Shift or Caps Lock keys do shift-lock.

Shift-lock means you don't have to hold the Shift key. For example, to enter T, press the Shift key, release, then press t.

How to Make CapsLock Do Shift-Lock

To make Caps Lock do shift-lock, run this in terminal:

# linux, set capslock as shift lock
setxkbmap -option caps:shiftlock

How to Make Shift Do Shift-Lock

Create a file at ~/.Xmodmap. The file content should be this:

! -*- coding: utf-8 -*-
! 2017-01-14

! make capslock and shift keys do shift lock

! here's the default setting on special keys
! xmodmap -pke | grep -iP '(shift|caps)'
! keycode  50 = Shift_L NoSymbol Shift_L
! keycode  62 = Shift_R NoSymbol Shift_R
! keycode  66 = Caps_Lock NoSymbol Caps_Lock
! keycode  92 = ISO_Level3_Shift NoSymbol ISO_Level3_Shift

! make capslock do shift lock
xmodmap -e "keycode 66 = Shift_Lock"

! make the left Shift key do shift lock
xmodmap -e "keycode 50 = Shift_Lock"

! make the right Shift key do shift lock
xmodmap -e "keycode 62 = Shift_Lock"

Now, run this line in terminal:

xmodmap ~/.Xmodmap

That's it.

When X11 starts, that file will be loaded automatically.

See also: Ban Shift Key

Linux Keybinding

  1. Keyboard Software Guide
  2. Swap Control Alt Keys
  3. Set F2 F3 F4 to Cut Copy Paste
  4. Swap CapsLock Escape Keys
  5. Make CapsLock Do Home Key
  6. Setup Shift Lock Key
  7. Add Keyboard Shortcut to Switch App
  8. Set Key Repeat Rate
  9. Set System Keyboard Layout
  10. How to Switch to Dvorak Keyboard Layout
  11. Change Volume by Command
  12. xmodmap
  13. xbindkeys
  14. xvkbd
  15. Find Keyboard Key Scancode
  16. X11 Keyboard Key Names

If you have a question, put $5 at patreon and message me.