public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ability to change SysRq scancode
@ 2005-07-09 20:44 federico
  2005-07-09 21:28 ` Alexey Dobriyan
  2005-07-12 17:25 ` [update] " federico
  0 siblings, 2 replies; 4+ messages in thread
From: federico @ 2005-07-09 20:44 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 356 bytes --]

i release this patch because my keyboard ("Mitsumi Electric Apple
Extended USB Keyboard" Bus=0003 Vendor=05ac Product=0205 Version=0122)
doesn't have a PrintScr key, so cannot send the right scancode, and
KEY_SYSRQ needs to be modified.

i hope that i've done in the right way ;)
it's tested by me, and it's working, yeah i'm pressing the SAK with F13 :P


[-- Attachment #2: sysrq_scancode.patch --]
[-- Type: text/x-patch, Size: 646 bytes --]

diff linux.orig/lib/Kconfig.debug linux/lib/Kconfig.debug
30a31,40
> 	  
> config MAGIC_SYSRQ_SCANCODE
> 	int
> 	prompt "Change default scancode of SysRq key" if MAGIC_SYSRQ
> 	default 99
> 	depends on MAGIC_SYSRQ
> 	help
> 	  If your keyboard hasn't a SysRq key, you can specify another key
> 	  which should act as SysRq. You can find the scancode on your
> 	  keyboard with programs like showkey or evtest.

diff linux.orig/include/linux/input.h linux/include/linux/input.h
206a207,210
> 
> #if defined(CONFIG_MAGIC_SYSRQ) && defined(CONFIG_MAGIC_SYSRQ_SCANCODE)
> #define KEY_SYSRQ		CONFIG_MAGIC_SYSRQ_SCANCODE
> #else
207a212,213
> #endif
>

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

* Re: [PATCH] ability to change SysRq scancode
  2005-07-09 20:44 [PATCH] ability to change SysRq scancode federico
@ 2005-07-09 21:28 ` Alexey Dobriyan
  2005-07-09 21:39   ` federico
  2005-07-12 17:25 ` [update] " federico
  1 sibling, 1 reply; 4+ messages in thread
From: Alexey Dobriyan @ 2005-07-09 21:28 UTC (permalink / raw)
  To: federico; +Cc: linux-kernel

On Sunday 10 July 2005 00:44, federico wrote:
> i release this patch because my keyboard ("Mitsumi Electric Apple
> Extended USB Keyboard" Bus=0003 Vendor=05ac Product=0205 Version=0122)
> doesn't have a PrintScr key, so cannot send the right scancode, and
> KEY_SYSRQ needs to be modified.
> 
> i hope that i've done in the right way ;)

diff -uprN please.

> it's tested by me, and it's working, yeah i'm pressing the SAK with F13 :P


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

* Re: [PATCH] ability to change SysRq scancode
  2005-07-09 21:28 ` Alexey Dobriyan
@ 2005-07-09 21:39   ` federico
  0 siblings, 0 replies; 4+ messages in thread
From: federico @ 2005-07-09 21:39 UTC (permalink / raw)
  To: linux-kernel, Alexey Dobriyan

[-- Attachment #1: Type: text/plain, Size: 423 bytes --]

Alexey Dobriyan ha scritto:

>On Sunday 10 July 2005 00:44, federico wrote:
>  
>
>>i release this patch because my keyboard ("Mitsumi Electric Apple
>>Extended USB Keyboard" Bus=0003 Vendor=05ac Product=0205 Version=0122)
>>doesn't have a PrintScr key, so cannot send the right scancode, and
>>KEY_SYSRQ needs to be modified.
>>
>>i hope that i've done in the right way ;)
>>    
>>
>
>diff -uprN please.
>  
>
here it is

[-- Attachment #2: sysrq_scancode2.patch --]
[-- Type: text/x-patch, Size: 1425 bytes --]

diff -uprN linux.orig/include/linux/input.h linux/include/linux/input.h
--- linux.orig/include/linux/input.h	2005-07-09 21:48:19.000000000 +0200
+++ linux/include/linux/input.h	2005-07-09 21:50:14.000000000 +0200
@@ -204,7 +204,13 @@ struct input_absinfo {
 #define KEY_KPENTER		96
 #define KEY_RIGHTCTRL		97
 #define KEY_KPSLASH		98
+
+#if defined(CONFIG_MAGIC_SYSRQ) && defined(CONFIG_MAGIC_SYSRQ_SCANCODE)
+#define KEY_SYSRQ		CONFIG_MAGIC_SYSRQ_SCANCODE
+#else
 #define KEY_SYSRQ		99
+#endif
+
 #define KEY_RIGHTALT		100
 #define KEY_LINEFEED		101
 #define KEY_HOME		102
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_SCANCODE
+	int
+	prompt "Change default scancode of SysRq key" if MAGIC_SYSRQ
+	default 99
+	depends on MAGIC_SYSRQ
+	help
+	  If your keyboard hasn't a SysRq key, you can specify another key
+	  which should act as SysRq. You can find the scancode on your
+	  keyboard with programs like showkey or evtest.
 
 config LOG_BUF_SHIFT
 	int "Kernel log buffer size (16 => 64KB, 17 => 128KB)" if DEBUG_KERNEL

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

* [update] Re: [PATCH] ability to change SysRq scancode
  2005-07-09 20:44 [PATCH] ability to change SysRq scancode federico
  2005-07-09 21:28 ` Alexey Dobriyan
@ 2005-07-12 17:25 ` federico
  1 sibling, 0 replies; 4+ messages in thread
From: federico @ 2005-07-12 17:25 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 626 bytes --]

federico ha scritto:

>i release this patch because my keyboard ("Mitsumi Electric Apple
>Extended USB Keyboard" Bus=0003 Vendor=05ac Product=0205 Version=0122)
>doesn't have a PrintScr key, so cannot send the right scancode, and
>KEY_SYSRQ needs to be modified.
>
>i hope that i've done in the right way ;)
>it's tested by me, and it's working, yeah i'm pressing the SAK with F13 :P
>  
>

fixed some typos in Kconfig and cleaned up the code.

this should be that last release of this patch.
it's tested and working (it's nothing else a simple one-line hack)

if someone wants to try please report results :)
ciao!
Federico


[-- Attachment #2: sysrq_keycode_r5.patch --]
[-- Type: text/x-patch, Size: 1536 bytes --]

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] 4+ messages in thread

end of thread, other threads:[~2005-07-12 17:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-09 20:44 [PATCH] ability to change SysRq scancode federico
2005-07-09 21:28 ` Alexey Dobriyan
2005-07-09 21:39   ` federico
2005-07-12 17:25 ` [update] " federico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox