Device driver for keyboard?

Hi Folks
how will you write device driver programs in C for devices like keyboard. What all headers are needed? It shouldnt be much complex just need to display the pressed key on the monitor. Or simple key redirections. If you know plz help me.

Comments

  • What operating system?

  • : What operating system?
    :
    :
    OS:Windows XP.
    I program in TurboC.
  • : OS:Windows XP.
    : I program in TurboC.

    I believe TurboC has a function 'bioskey' that will let you poll the keyboard state. If not, it's INT 16H.

    Of course, unless you just like learning about DOS for historical reasons, there's little reason to be using a DOS compiler in Windows. Borland has a free Windows compiler, I believe Microsoft just released a free version of their IDE, and there are many others. In Windows, you would call GetKeyboardState or GetAsyncKeyState.

  • : : OS:Windows XP.
    : : I program in TurboC.
    :
    : I believe TurboC has a function 'bioskey' that will let you poll the keyboard state. If not, it's INT 16H.
    :
    : Of course, unless you just like learning about DOS for historical reasons, there's little reason to be using a DOS compiler in Windows. Borland has a free Windows compiler, I believe Microsoft just released a free version of their IDE, and there are many others. In Windows, you would call GetKeyboardState or GetAsyncKeyState.
    :
    :
    [green]I do not believe that winxp will permit a "DOS" program access to the hardware. You need to use real DOS or win98 or earlier or winme.[/green]
  • [green]: I do not believe that winxp will permit a "DOS" program access to the
    : hardware. You need to use real DOS or win98 or earlier or winme.[/green]

    No version of NT will, but that doesn't mean bioskey won't work. NT (2K,XP,etc.) runs DOS programs in a virtual machine that emulates the BIOS, among other things.

  • [green]A hack is to write bios-access code in a 16 bit DLL. The call that DLL from a Win32 app via thunking.[/green]

    [hr];-) [b][size=4][red]~Bikram[/red][/size][/b]

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