Index: src/etc/defaults/rc.conf =================================================================== RCS file: /home/ncvs/src/etc/defaults/rc.conf,v retrieving revision 1.191 diff -u -r1.191 rc.conf --- src/etc/defaults/rc.conf 28 Nov 2003 17:28:42 -0000 1.191 +++ src/etc/defaults/rc.conf 9 Dec 2003 08:59:31 -0000 @@ -353,6 +353,7 @@ # start like mousechar_start=3, see vidcontrol(1) allscreens_flags="" # Set this vidcontrol mode for all virtual screens allscreens_kbdflags="" # Set this kbdcontrol mode for all virtual screens +alt_is_meta="NO" # Let the Alt keys double as Meta keys ############################################################## Index: src/etc/rc.d/syscons =================================================================== RCS file: /home/ncvs/src/etc/rc.d/syscons,v retrieving revision 1.9 diff -u -r1.9 syscons --- src/etc/rc.d/syscons 9 Sep 2002 22:40:34 -0000 1.9 +++ src/etc/rc.d/syscons 9 Dec 2003 09:04:30 -0000 @@ -102,6 +102,17 @@ ;; esac + # enable Meta functionality for Alt keys + # + case ${alt_is_meta} in + [Nn][Oo]) + ;; + *) + echo -n ' alt_is_meta' + sysctl kern.alt_is_meta=1 > /dev/null + ;; + esac + # cursor type # case ${cursor} in Index: src/share/man/man5/rc.conf.5 =================================================================== RCS file: /home/ncvs/src/share/man/man5/rc.conf.5,v retrieving revision 1.202 diff -u -r1.202 rc.conf.5 --- src/share/man/man5/rc.conf.5 10 Nov 2003 16:04:48 -0000 1.202 +++ src/share/man/man5/rc.conf.5 9 Dec 2003 09:01:57 -0000 @@ -1974,6 +1974,17 @@ The value should be a single string of the form: .Dq Ar funkey_number new_value Op Ar funkey_number new_value ... . +.It Ar alt_is_meta +.Pq Vt bool +If set to +.Ar YES , +the +.Dq Alt +keys on the keyboard shall also function as +.Dq Meta +keys (sending an +.Dq Escape +code before the keycode of the simultaneously pressed key). .It Va cursor .Pq Vt str Can be set to the value of Index: src/sys/dev/kbd/kbd.c =================================================================== RCS file: /home/ncvs/src/sys/dev/kbd/kbd.c,v retrieving revision 1.36 diff -u -r1.36 kbd.c --- src/sys/dev/kbd/kbd.c 9 Nov 2003 09:17:21 -0000 1.36 +++ src/sys/dev/kbd/kbd.c 9 Dec 2003 08:59:41 -0000 @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -79,6 +80,9 @@ SYSCTL_INT(_hw_kbd, OID_AUTO, keymap_restrict_change, CTLFLAG_RW, &keymap_restrict_change, 0, "restrict ability to change keymap"); +static int alt_is_meta = 0; +SYSCTL_INT(_kern, OID_AUTO, alt_is_meta, CTLFLAG_RW, &alt_is_meta, 0, ""); + #define ARRAY_DELTA 4 static int @@ -1204,6 +1208,8 @@ /* FALL THROUGH */ case LALT: state &= ~ALTS1; + if (alt_is_meta) + state &= ~METAS1; break; case RALTA: if (state & SHIFTAON) { @@ -1214,6 +1220,8 @@ /* FALL THROUGH */ case RALT: state &= ~ALTS2; + if (alt_is_meta) + state &= ~METAS2; break; case ASH: state &= ~AGRS1; @@ -1321,6 +1329,8 @@ /* FALL THROUGH */ case LALT: state |= ALTS1; + if (alt_is_meta) + state |= METAS1; break; case RALTA: state |= SHIFTAON; @@ -1328,6 +1338,8 @@ /* FALL THROUGH */ case RALT: state |= ALTS2; + if (alt_is_meta) + state |= METAS2; break; case ASH: state |= AGRS1;