Chances are that your Shift key is getting stuck. Try pressing and releasing your Shift key (both, if you have a left and a right key). This is most likely to be a hardware issue if you haven't noticed other keys getting stuck.
When the problem happens, run xterm -e xev
(you might want to have an icon or menu entry ready so that you can launch xev
with only mouse clicks). When you press a key in the xev
window, you'll see output like
KeyPress event, serial 32, synthetic NO, window 0x3000001,
root 0xa5, subw 0x0, time 201838723, (221,316), root:(232,403),
state 0x0, keycode 38 (keysym 0x61, a), same_screen YES,
XLookupString gives 1 bytes: (61) "a"
XmbLookupString gives 1 bytes: (61) "a"
XFilterEvent returns: False
state 0x0
means that there is no modifier. With a Shift
modifier down, you'd see state 0x1
. The Lock
(a.k.a. Caps Lock) modifier is state 0x2
; more generally, with several modifiers down, you'll see a bitwise mask of the modifiers (e.g. state 0x5
if you have both Shift
(1) and Ctrl
(4) down). If the problem persists, tell us how the xev
output deviates from what you expect.
I suppose you have acpid
installed, in this case you should place a (an even empty) file at /etc/acpi/events/powerbtn
as the default handler checks if this file exists and if it is, it will not initiate a shutdown on its own.
From /etc/acpid/powerbtn-acpi-support.sh
:
if [ -f /etc/acpi/events/powerbtn -o -f /etc/acpi/events/powerbtn.dpkg-bak ] ; then
logger Acpi-support not handling power button, acpid handler exists at /etc/acpi/events/powerbtn or /etc/acpi/events/powerbtn.dpkg-bak.
exit 0
fi
Just to be totally sure, you can also comment out the line #31 having:
/sbin/shutdown -h -P now "Power button pressed"
in the very same file.
Best Answer
Open vim
Even the most intelligent cat will not be able to exit vim.