Date: Wednesday, 18 January 1989  13:31-MST
From: Rich Kennerly <LVL@CORNELLA.CIT.CORNELL.EDU>
Newsgroups: comp.sys.ibm.pc
Re:   Enhanced keyboards

   Here is a list of the extra keys on an enhanced keyboard:

Enhanced Keyboard key:                  BIOS value:
                                        base    shift   cntrl   alt
F11                                     8500    8700    8900    8b00
F12                                     8600    8800    8A00    8C00
kp-Enter                                E00D    E00D    E00D    A600
KP-/                                    E02F    E02F    9500    A400
KP-*                                    372A    372A    9600    3700

HOME                                    47E0    47E0    77E0    9700
UP ARROW                                48E0    48E0    8DE0    9800
PAGE UP                                 49E0    49E0    84E0    9900
LEFT ARROW                              4BE0    4BE0    73E0    9B00
RIGHT ARROW                             4DE0    4DE0    74E0    9D00
END                                     4FE0    4FE0    75E0    9F00
DOWN ARROW                              50E0    50E0    91E0    A000
PAGE DOWN                               51E0    51E0    76E0    A100
INSERT                                  52E0    52E0    92E0    A200
DELETE                                  53E0    53E0    93E0    A300

Note that you cannot get these values with the old BIOS interrupt,
it will remove the E0's to be compatible with the old keyboard.  See
the following code fragments that use the old and new BIOS calls.


getkey_     PROC   NEAR         ; get key code for standard keyboard
            mov    ah,01H
            int    16h
            jnz    GOTAKEY
            mov    ax,00H
            ret
GOTAKEY:
            mov    ah,00H
            int    16h
            ret
getkey_     ENDP

getxkey_    PROC   NEAR         ; get key code for enhanced keyboard
            mov    ah,11H
            int    16h
            jnz    GOTXKEY
            mov    ax,0
            ret
GOTXKEY:
            mov    ah,10H
            int    16h
            ret
getxkey_    ENDP

I have found that an AT with old keyboard and old BIOS (you need the
new BIOS to fully appreciate the enhanced keyboard) will get very
upset if you try to use the new BIOS function calls with it.  Here
is a routine that will look into the BIOS data area to see if BIOS
found an enhanced keyboard at INIT time.  Note that this approach is
not ideal since IBM and others can change the layout of BIOS at
will; fortunately they never seem to.  In any case there is no
interrupt call that will tell you this (if there is let me know
please).

; gkybdtype returns 0 for standard 84 key kybd, 10H for enhanced keyboard

        KB_FLAG_3       equ 096H        ; address of keyboard flag byte
        KBX             equ 00010000B   ; enhanced keyboard flag bit

gkybdtype_      proc near
        push    es
        mov     ax,40H
        mov     es, ax
        mov     ax,es:[KB_FLAG_3]
        and     ax,KBX
        pop     es
        ret
gkybdtype_      endp


RICH KENNERLY - LVL@CORNELLA.CIT.CORNELL.EDU
CIT - Network Development
125 Caldwell Hall
607-255-7342
