Programmatically Clearing Caps Lock In Linux

I'm not particularly a fan of caps lock. I typically re-map the caps lock key to do something more useful. Sometimes caps lock becomes enabled accidentally or because some application enables it to be "helpful". Here's a little python script I keep around to disable caps lock from a terminal/shell just in case.

#!/usr/bin/env python
from ctypes import *
X11 = cdll.LoadLibrary("")
display = X11.XOpenDisplay(None)
X11.XkbLockModifiers(display, c_uint(0x0100), c_uint(2), c_uint(0))

1 comment