; ===========================================================================
; DoubleDOS
; ===========================================================================

dbldoskeybf dw 0
;Bitfields for DoubleDOS keyboard control flags:
;Bit(s) Description (Table 02088)
;0 menu
;1 exchange
;2 entire keyboard enable/disable
;3 Ctrl-C
;4 Ctrl-PrtSc
;5 Alt/Erase
;6 Ctrl-Break
;7 Ctrl-NumLock
;8 shift-PrtSc
;9-13 undefined
;14 cancel key (clear keyboard buffer)
;15 suspend key
;Note: Setting a enables the corresponding key or operatin,
;clearing a disables it

DoubleDOS_F_e3 proc far
; DoubleDOS - ADD CHARACTER TO KEYBOARD BUFFER OF CURRENT JOB
      ; mov  byte ptr cs:[keybuffer+keybpos], al
      mov  al, 1
      ; Return: AL = 00h successful
      ;              01h buffer full (128 characters)
      ; SeeAlso: AH=E3h"DoubleDOS",AH=F1h"DoubleDOS",AH=F2h"DoubleDOS"
      ; SeeAlso: AH=F8h"DoubleDOS"
      ret
DoubleDOS_F_e3 endp

DoubleDOS_F_e8 proc far
; DoubleDOS - SET/RESET KEYBOARD CONTROL FLAGS
      cmp  al, 0
      jne  DDSKFO
           mov  cs:dbldoskeybf, dx
      jmp  DDSKFX
DDSKFO:
      cmp  al, 01h
      jne  DDSKFX
           mov  cs:dbldoskeybf, dx
DDSKFX:
      ret
DoubleDOS_F_e8 endp

DoubleDOS_F_ee proc far
      cmp  al, 1 
      jne  _DDDOS_X
           call cs:TimeSlice       ; INT28 - Release TimeSlice
      jmp  _DDDOS_X
_DDDOS_X:
      ret
DoubleDOS_F_ee endp

DoubleDOS_F_f3 proc far
; DoubleDOS - ADD CHARACTER TO KEYBOARD BUFFER OF CURRENT JOB
      call DoubleDOS_F_e3
      ret
DoubleDOS_F_f3 endp
