Subject: allow the old behavior of Alt+SysRq+ This should allow any order of Alt + SysRq press followed by any key while still holding one of SysRq or Alt. Signed-off-by: Paulo Marques --- ./drivers/char/keyboard.c.orig 2006-07-12 13:03:32.000000000 +0100 +++ ./drivers/char/keyboard.c 2006-07-12 14:18:52.000000000 +0100 @@ -150,7 +150,7 @@ unsigned char kbd_sysrq_xlate[KEY_MAX + "230\177\000\000\213\214\000\000\000\000\000\000\000\000\000\000" /* 0x50 - 0x5f */ "\r\000/"; /* 0x60 - 0x6f */ static int sysrq_down; -static int sysrq_alt_use; +static int sysrq_active; #endif static int sysrq_alt; @@ -1164,16 +1164,17 @@ static void kbd_keycode(unsigned int key printk(KERN_WARNING "keyboard.c: can't emulate rawmode for keycode %d\n", keycode); #ifdef CONFIG_MAGIC_SYSRQ /* Handle the SysRq Hack */ - if (keycode == KEY_SYSRQ && (sysrq_down || (down == 1 && sysrq_alt))) { - if (!sysrq_down) { - sysrq_down = down; - sysrq_alt_use = sysrq_alt; - } + if (keycode == KEY_SYSRQ) { + sysrq_down = down; return; } - if (sysrq_down && !down && keycode == sysrq_alt_use) - sysrq_down = 0; - if (sysrq_down && down && !rep) { + + if (sysrq_down && sysrq_alt) + sysrq_active = 1; + else if (!sysrq_down && !sysrq_alt) + sysrq_active = 0; + + if (sysrq_active && down && !rep) { handle_sysrq(kbd_sysrq_xlate[keycode], regs, tty); return; }