Keyboard buffer - Urgent.

How to clear keyboard buffer using intr($16) or any other stuff? I'm writing something like getkeyevent in TP, but something's wrong and I need to clear keyboard buffer first - so how to do it?

Sorrow.


Comments

  • : How to clear keyboard buffer using intr($16) or any other stuff? I'm writing something like getkeyevent in TP, but something's wrong and I need to clear keyboard buffer first - so how to do it?
    :
    : Sorrow.
    :

    procedure clear_the_fucking_keyboard_buffer;
    begin
    while keypressed do readkey;
    end;

    well, this is the easy and ugly way, but it works fine.

    the cool way would be to modify the keyboardbuffer
    directly. it's a ringbuffer, and somewhere in the bios
    data area are pointers to the head and the tail of the queue.


  • Well, I know a way to clear the keyboard buffer with interrupt, but it is the one in int 21h.

    asm
    mov ah, 0Ch
    xor al, al
    int 21h
    end;

    The value for ax should be 0C00, it should be the same as moving that value to ax directly.

    Phase Zero


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories