summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/klibc-kbd/keymap_hook
blob: 913b247c27abece1f5322f0733afc212808b4b66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# vim: set ft=sh:
run_hook ()
{
    msg -n ":: Loading keymap..."
    . /keymap
    if [ "${UTF8}" = "yes" ]; then
        /bin/kbd_mode -u
        printf "\033%%G" >> /dev/console
        [ -n "${KEYMAP}" ] && /bin/loadkeys -q -u ${KEYMAP}
    else
        /bin/kbd_mode -a
        printf "\033%%@" >> /dev/console
        [ -n "${KEYMAP}" ] && /bin/loadkeys -q ${KEYMAP}
    fi
    if [ -n "${CONSOLEFONT}" ]; then
        if [ "${UTF8}" = "yes" ]; then
             CONSOLEMAP=""
        fi
        if [ -n "${CONSOLEMAP}" ]; then
            /bin/setfont -m ${CONSOLEMAP} ${CONSOLEFONT} -C /dev/console
        else
            /bin/setfont ${CONSOLEFONT} -C /dev/console
        fi
        printf "\033(K" >> /dev/console
    fi
    msg "done."
}