Cleanup keymaps a little.

This commit is contained in:
Roy Marples 2008-01-30 16:36:18 +00:00
parent 67f792ce4c
commit 05e5865bdc

View File

@ -31,7 +31,6 @@ start()
return 1
fi
local loadkeys_uni= wkeys=
local ttydev= n=
[ -d /dev/vc ] \
&& ttydev=/dev/vc/ \
@ -42,17 +41,9 @@ start()
echo 1 > /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes
fi
# Turn on unicode if user wants it
if yesno ${unicode}; then
n=1
while [ ${n} -le "${ttyn}" ]; do
kbd_mode -u -C "${ttydev}${n}"
n=$((${n} + 1))
done
loadkeys_uni="--unicode"
fi
ebegin "Loading key mappings"
local loadkeys_uni= wkeys=
yesno ${unicode} && loadkeys_uni="--unicode"
yesno ${windowskeys} && wkeys="windowkeys"
loadkeys -q ${loadkeys_uni} ${wkeys} ${keymap} ${extended_keymaps}
eend $? "Error loading key mappings" || return $?
@ -64,21 +55,20 @@ start()
# Set terminal encoding to either ASCII or UNICODE.
# See utf-8(7) for more information.
local termencoding= termmsg=
local termencoding="%@" termmsg="ASCII" kmode="-a"
if yesno ${unicode}; then
dumpkeys ${dumpkeys_charset:+-c} \
${dumpkeys_charset} | loadkeys --unicode
termencoding="%G"
termmsg="UTF-8"
else
termencoding="%@"
termmsg="ASCII"
kmode="-u"
fi
ebegin "Setting terminal encoding to" ${termmsg}
n=1
while [ ${n} -le "${ttyn}" ]; do
printf "\033%s" "${termencoding}" >"${ttydev}${n}"
kbd_mode "${kmode}" -C "${ttydev}${n}"
n=$((${n} + 1))
done
eend 0