[comp.unix.microport] Getting right Alt key to switch virtual consoles

jeff@nucleus.mi.org (Jeff Marraccini) (01/14/90)

Below is a simple way to get the right Alt key to act like the left one
when switching virtual consoles.  I placed this file in
/etc/rc.d/swapkey.rc, since it also swaps the right control and Alt keys
that are backwards in the Enhanced keyboard support.

Note: This "fix" requires System V/AT release 2.4.

I've extensively revised the /etc/rc.d files to make them more verbose
and robust.  Send me e-mail if you would like a copy of them.

Jeff

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  swapkey.rc
# Wrapped by jeff@nucleus on Sun Jan 14 09:35:50 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f swapkey.rc -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"swapkey.rc\"
else
echo shar: Extracting \"swapkey.rc\" \(599 characters\)
sed "s/^X//" >swapkey.rc <<'END_OF_swapkey.rc'
X# written by jeff@nucleus.mi.org
X# added mapkey commands to map RightAlt-F1 ... F8 to work the same as the
X# LeftAlt-F1, etc. keys
X#
Xif [ -x /etc/cons ]; then
X	echo "	Swapping right Alt and Ctrl keys\c" >/dev/console
X	/etc/cons swapkey 96 97
X	echo "." >/dev/console
Xfi
Xif [ -x /etc/mapkey ]; then
X	echo "	Setting up right Alt to act like left Alt\c" >/dev/console
X	/etc/mapkey ralt f1 -c 0
X	/etc/mapkey ralt f2 -c 1
X	/etc/mapkey ralt f3 -c 2
X	/etc/mapkey ralt f4 -c 3
X	/etc/mapkey ralt f5 -c 4
X	/etc/mapkey ralt f6 -c 5
X	/etc/mapkey ralt f7 -c 6
X	/etc/mapkey ralt f8 -c 7
X	echo "." >/dev/console
Xfi
END_OF_swapkey.rc
if test 599 -ne `wc -c <swapkey.rc`; then
    echo shar: \"swapkey.rc\" unpacked with wrong size!
fi
chmod +x swapkey.rc
# end of overwriting check
fi
echo shar: End of shell archive.
exit 0

--
  Jeff Marraccini  jeff@nucleus.mi.org  ...!<internet>!sharkey!nucleus!jeff
      nucleus: Public access Unix, +1 313 623-6309, 1200/2400bps, no fee