Fixing a stuck control key without rebooting
If you’ve messed with xte or xdotool, you’ve inevitably found your computer…not typing right. Turns out, your control is stuck down with no way of unsticking it. You begrudingly reboot the computer.
Last week, that was me, here’s a solution to the problem:
write a keyup-modifiers script
#!/usr/bin/env bash echo keyup Control_L | xte echo keyup Control_R | xte echo keyup Shift_L | xte echo keyup Shift_R | xte echo keyup Meta_L | xte echo keyup Meta_R | xte echo keyup Alt_L | xte echo keyup Alt_R | xte echo keyup Super_L | xte echo keyup Super_R | xte
Bind it to your window manager’s keychord alt + shift + ctrl + c in i3. the c doesn’t matter but alt + shift + ctrl is super important as it’ll work no matter which one’s accidentally stuck.
in i3 this is
bindsym $mod+Shift+Control+c exec keyup-modifiers
And voila, no more rebooting.