linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] input: change SysRq keycode for systems without SysRq key
@ 2007-07-15 17:04 federico ferri
  2007-07-15 18:03 ` Linus Torvalds
  0 siblings, 1 reply; 22+ messages in thread
From: federico ferri @ 2007-07-15 17:04 UTC (permalink / raw)
  To: torvalds; +Cc: dmitry.torokhov, linux-input, trivial

this patch adds an entry in Kconfig after 'config MAGIC_SYSRQ' which
asks for a different keycode (replacing also KEY_SYSRQ with
CONFIG_MAGIC_SYSRQ_KEYCODE in char/keyboard.c)

it was tested on some USB keyboards (Microsoft and Apple USB keyboards,
and it works)

I sumbitted this patch two years ago, but it was ignored.

I think this patch is very important, even to a non-developer (SysRq-k
is very helpful when testing unstable software/drivers)

[for 2.6]

Signed-off-by: Federico Ferri <xaero@inwind.it>

---

diff -uprN linux.orig/drivers/char/keyboard.c linux/drivers/char/keyboard.c
--- linux.orig/drivers/char/keyboard.c	2005-07-09 21:47:50.000000000 +0200
+++ linux/drivers/char/keyboard.c	2005-07-10 14:42:34.000000000 +0200
@@ -1081,7 +1087,7 @@ 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 (keycode == CONFIG_MAGIC_SYSRQ_KEYCODE && (sysrq_down || (down == 1
&& sysrq_alt))) {
 		sysrq_down = down;
 		return;
 	}
diff -uprN linux.orig/lib/Kconfig.debug linux/lib/Kconfig.debug
--- linux.orig/lib/Kconfig.debug	2005-07-09 21:47:22.000000000 +0200
+++ linux/lib/Kconfig.debug	2005-07-09 21:50:44.000000000 +0200
@@ -28,6 +28,16 @@ config MAGIC_SYSRQ
 	  send a BREAK and then within 5 seconds a command keypress. The
 	  keys are documented in <file:Documentation/sysrq.txt>. Don't say Y
 	  unless you really know what this hack does.
+	
+config MAGIC_SYSRQ_KEYCODE
+	int
+	prompt "Change SysRq key-code" if MAGIC_SYSRQ
+	default 99
+	depends on MAGIC_SYSRQ
+	help
+	  If your keyboard doesn't have a SysRq key (also labeled PrintScr),
+	  you can specify another keycode which should act as SysRq.
+	  Default is 99 (KEY_SYSRQ).
+	  You can find this number using programs like evtest, or (maybe)
+	  showkey.

 config LOG_BUF_SHIFT
 	int "Kernel log buffer size (16 => 64KB, 17 => 128KB)" if DEBUG_KERNEL

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2007-08-17 15:01 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-15 17:04 [PATCH] input: change SysRq keycode for systems without SysRq key federico ferri
2007-07-15 18:03 ` Linus Torvalds
2007-07-15 18:34   ` federico ferri
2007-07-15 18:57     ` Linus Torvalds
2007-07-15 22:04       ` federico ferri
2007-07-15 22:15         ` Linus Torvalds
2007-07-16 12:41           ` Dmitry Torokhov
2007-07-17  6:40             ` federico ferri
2007-07-17 15:11               ` Dmitry Torokhov
2007-07-18 20:55                 ` federico ferri
2007-07-19 21:00                   ` Dmitry Torokhov
2007-07-19 21:00                     ` Dmitry Torokhov
2007-07-19 21:39                     ` federico ferri
2007-07-19 22:32                       ` Dmitry Torokhov
2007-07-19 23:29                         ` federico ferri
2007-07-30 14:09                           ` Jiri Kosina
2007-08-02 21:27                             ` Vojtech Pavlik
2007-08-17  8:25                               ` Marvin Raaijmakers
2007-08-17 10:22                                 ` Jiri Kosina
2007-08-17 14:35                                   ` Marvin Raaijmakers
2007-08-17 14:42                                     ` Jiri Kosina
2007-08-17 15:01                                       ` Marvin Raaijmakers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).