Subject: Re: USB keyboard + wscons issues
To: None <tech-kern@netbsd.org, port-i386@netbsd.org>
From: Pavel Cahyna <pcah8322@artax.karlin.mff.cuni.cz>
List: tech-kern
Date: 10/30/2005 13:39:16
--OXfL5xGRrasGEqWY
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Sun, Oct 30, 2005 at 03:06:23AM -0500, Sean Davis wrote:
> 2) is it possible to (without modding the kernel) change the key combo
> required to switch virtual consoles? I commonly use shift-alt-f3 to maximize
> konsoles in KDE, and it's easy to hit control instead of shift by mistake.

Is shift-control-F enough for you? In that case apply the attached patch
under /usr/X11R6/lib/X11/xkb, restart X and execute 'setxkbmap -option
srvrkeys:shift'.

Pavel Cahyna

--OXfL5xGRrasGEqWY
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="xkb.patch"

diff -u /usr/xsrc-4.5/xfree/xc/programs/xkbcomp/symbols/srvr_ctrl symbols/srvr_ctrl
--- /usr/xsrc-4.5/xfree/xc/programs/xkbcomp/symbols/srvr_ctrl	2004-03-05 15:27:21.000000000 +0100
+++ symbols/srvr_ctrl	2005-10-30 12:42:48.000000000 +0100
@@ -107,6 +107,71 @@
 
 };
 
+partial function_keys 
+xkb_symbols "shfkey2vt" {
+
+    key <FK01> {
+	type="CTRL+SHIFT",
+	symbols[Group1]= [ F1,	XF86_Switch_VT_1 ]
+    };
+
+    key <FK02> {
+	type="CTRL+SHIFT",
+	symbols[Group1]= [ F2,	XF86_Switch_VT_2 ]
+    };
+
+    key <FK03> {
+	type="CTRL+SHIFT",
+	symbols[Group1]= [ F3,	XF86_Switch_VT_3 ]
+    };
+
+    key <FK04> {
+	type="CTRL+SHIFT",
+	symbols[Group1]= [ F4,	XF86_Switch_VT_4 ]
+    };
+
+    key <FK05> {
+	type="CTRL+SHIFT",
+	symbols[Group1]= [ F5,	XF86_Switch_VT_5 ]
+    };
+
+    key <FK06> {
+	type="CTRL+SHIFT",
+	symbols[Group1]= [ F6,	XF86_Switch_VT_6 ]
+    };
+
+    key <FK07> {
+	type="CTRL+SHIFT",
+	symbols[Group1]= [ F7,	XF86_Switch_VT_7 ]
+    };
+
+    key <FK08> {
+	type="CTRL+SHIFT",
+	symbols[Group1]= [ F8,	XF86_Switch_VT_8 ]
+    };
+
+    key <FK09> {
+	type="CTRL+SHIFT",
+	symbols[Group1]= [ F9,	XF86_Switch_VT_9 ]
+    };
+
+    key <FK10> {
+	type="CTRL+SHIFT",
+	symbols[Group1]= [ F10,	XF86_Switch_VT_10 ]
+    };
+
+    key <FK11> {
+	type="CTRL+SHIFT",
+	symbols[Group1]= [ F11,	XF86_Switch_VT_11 ]
+    };
+
+    key <FK12> {
+	type="CTRL+SHIFT",
+	symbols[Group1]= [ F12,	XF86_Switch_VT_12 ]
+    };
+
+};
+
 partial function_keys keypad_keys
 xkb_symbols "no_srvr_keys" {
 

--- /usr/xsrc-4.5/xfree/xc/programs/xkbcomp/types/pc	2001-06-09 17:14:32.000000000 +0200
+++ types/pc	2005-10-30 12:39:42.000000000 +0100
@@ -30,4 +30,11 @@
 	level_name[Level1] = "Base";
 	level_name[Level2] = "Ctrl+Alt";
     };
+
+    type "CTRL+SHIFT" {
+	modifiers = Control+Alt+Shift;
+	map[Control+Shift] = Level2;
+	level_name[Level1] = "Base";
+	level_name[Level2] = "Ctrl+Shift";
+    };
 };
--- /usr/xsrc-4.5/xfree/xc/programs/xkbcomp/rules/xfree86	2005-04-06 22:01:03.000000000 +0200
+++ rules/xfree86	2005-10-30 12:44:35.000000000 +0100
@@ -184,6 +185,7 @@
   compose:rwin		=	+compose(rwin)
   compose:menu		=	+compose(menu)
   srvrkeys:none		=	+srvr_ctrl(no_srvr_keys)
+  srvrkeys:shift	=	+srvr_ctrl(shfkey2vt)
 
 ! option		=	compat
   grp_led:num		=	+leds(num)

--OXfL5xGRrasGEqWY--