What kind of user input exactly?
Keyboard:
mov ah, 0 ; 88-key keyboard
int 22 ; al = ascii code, ah = scancode
; or
mov ah, 16 ; extended
int 22 ; al = ascii code, ah = scancode
COM:
mov ah, 0 ; initialize
mov al, 11100011b ; 9600 boud / no parity / 8-bit sequence + 1-bit stop
mov dx, COM_NUMBER ; 0 - 3
int 20 ; al = model status, ah = line status
; and then
mov ah, 3 ; receive
mov dx, COM_NUMBER ; 0 - 3
int 20 ; al = byte, ah = line status
Mouse:
mov ax, 0xC200 ; activate / deactivate
mov bh, 1 ; activate
int 21 ; cf = error, al = status
; and then
mov word [cs:callback_proc + 2], cs
mov ax, 0xC207 ; setup callback
les bx, [callback_proc]
int 21 ; cf = error
; callback ptotype
mouse_callback:
virtual at bp + 6
.state dw ?
.X dw ?
.Y dw ?
.flags dw ? ; always zero (reserved)
end virtual
push bp
mov bp, sp
leave
retf
callback_proc dd mouse_callback and 0xFFFF