src/doskbd.c
/************************************************************************/
/*                                                                      */
/*                      E X I T   D O S   K B D                         */
/*                                                                      */
/*      Turn off the DOS keyboard handler, and reinstall the            */
/*      normal DOS handler.                                             */
/************************************************************************/
E X I T   D O S   K B D

Turn off the DOS keyboard handler, and reinstall the
normal DOS handler.
E X I T D O S K B D Turn off the DOS keyboard handler and reinstall the normal DOS handler .
void ExitDosKbd(KbdInterface kbd)
{
  if (kbd->device.active == TRUE) {
    kbd->device.active = FALSE;
    _dpmi_unlockregion((void *)&currentkbd, sizeof(currentkbd));
    _dpmi_unlockregion((void *)kbd, sizeof(*kbd));
    _dpmi_unlockregion((void *)&InterfacePage, sizeof(InterfacePage));
    _dpmi_unlockregion((void *)InterfacePage, sizeof(IFPAGE));
    _dpmi_unlockregion((void *)&IOPage68K, sizeof(IOPage68K));
    _dpmi_unlockregion((void *)IOPage68K, sizeof(IOPAGE));
    _dpmi_unlockregion((void *)&CTopKeyevent, sizeof(CTopKeyevent));
    _dpmi_unlockregion((void *)CTopKeyevent, sizeof(*CTopKeyevent));
    _dpmi_unlockregion((void *)&MachineState, sizeof(MachineState));
    _dpmi_unlockregion((void *)&KEYBUFFERING68k, sizeof(KEYBUFFERING68k));
    _dpmi_unlockregion((void *)&ExitDosKbd, 4096);
    _dpmi_unlockregion((void *)&Kbd_event, 4096);
    _dos_setvect(0x09, kbd->prev_handler); 
  }
}
void ExitDosKbd ( KbdInterface kbd ) { if ( kbd -> device . active == TRUE ) { kbd -> device . active = FALSE ; _dpmi_unlockregion ( ( void * ) & currentkbd , sizeof ( currentkbd ) ) ; _dpmi_unlockregion ( ( void * ) kbd , sizeof ( * kbd ) ) ; _dpmi_unlockregion ( ( void * ) & InterfacePage , sizeof ( InterfacePage ) ) ; _dpmi_unlockregion ( ( void * ) InterfacePage , sizeof ( IFPAGE ) ) ; _dpmi_unlockregion ( ( void * ) & IOPage68K , sizeof ( IOPage68K ) ) ; _dpmi_unlockregion ( ( void * ) IOPage68K , sizeof ( IOPAGE ) ) ; _dpmi_unlockregion ( ( void * ) & CTopKeyevent , sizeof ( CTopKeyevent ) ) ; _dpmi_unlockregion ( ( void * ) CTopKeyevent , sizeof ( * CTopKeyevent ) ) ; _dpmi_unlockregion ( ( void * ) & MachineState , sizeof ( MachineState ) ) ; _dpmi_unlockregion ( ( void * ) & KEYBUFFERING68k , sizeof ( KEYBUFFERING68k ) ) ; _dpmi_unlockregion ( ( void * ) & ExitDosKbd , 4096 ) ; _dpmi_unlockregion ( ( void * ) & Kbd_event , 4096 ) ; _dos_setvect ( 0x09 , kbd -> prev_handler ) ; } }
E X I T   D O S   K B D
E X I T D O S K B D
/* unhook our handlr, install previous*/