Index: src/etc/defaults/rc.conf =================================================================== RCS file: /home/ncvs/src/etc/defaults/rc.conf,v retrieving revision 1.53.2.37 diff -u -r1.53.2.37 rc.conf --- src/etc/defaults/rc.conf 2001/08/01 20:14:06 1.53.2.37 +++ src/etc/defaults/rc.conf 2001/08/02 10:29:25 @@ -305,6 +305,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.syscons =================================================================== RCS file: /home/ncvs/src/etc/rc.syscons,v retrieving revision 1.1.2.1 diff -u -r1.1.2.1 rc.syscons --- src/etc/rc.syscons 2001/02/27 20:03:28 1.1.2.1 +++ src/etc/rc.syscons 2001/07/24 08:36:24 @@ -80,6 +80,17 @@ ;; esac +# enable Meta functionality for Alt keys +# +case ${alt_is_meta} in +[Nn][Oo]) + ;; +*) + echo -n ' alt_is_meta' + sysctl -w 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.64.2.38 diff -u -r1.64.2.38 rc.conf.5 --- src/share/man/man5/rc.conf.5 1 Feb 2002 15:51:18 -0000 1.64.2.38 +++ src/share/man/man5/rc.conf.5 3 Feb 2002 09:08:47 -0000 @@ -1364,6 +1364,17 @@ attempt to program the function keys with the value. The value should be a single string of the form: .Qq Ar " [ ]..." +.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.17.2.2 diff -u -r1.17.2.2 kbd.c --- src/sys/dev/kbd/kbd.c 2001/07/30 16:46:43 1.17.2.2 +++ src/sys/dev/kbd/kbd.c 2001/08/01 07:09:45 @@ -40,6 +40,7 @@ #include #include +#include #include @@ -69,6 +70,9 @@ static keyboard_switch_t *kbdsw_ini; keyboard_switch_t **kbdsw = &kbdsw_ini; +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 @@ -1073,6 +1077,8 @@ /* FALL THROUGH */ case LALT: state &= ~ALTS1; + if (alt_is_meta) + state &= ~METAS1; break; case RALTA: if (state & SHIFTAON) { @@ -1083,6 +1089,8 @@ /* FALL THROUGH */ case RALT: state &= ~ALTS2; + if (alt_is_meta) + state &= ~METAS2; break; case ASH: state &= ~AGRS1; @@ -1190,6 +1198,8 @@ /* FALL THROUGH */ case LALT: state |= ALTS1; + if (alt_is_meta) + state |= METAS1; break; case RALTA: state |= SHIFTAON; @@ -1197,6 +1207,8 @@ /* FALL THROUGH */ case RALT: state |= ALTS2; + if (alt_is_meta) + state |= METAS2; break; case ASH: state |= AGRS1;