Advertisement

Input (dos vga stuff)

Started by October 14, 2000 05:47 PM
2 comments, last by NightBird 24 years, 2 months ago
i have a couple of questions regarding input: 1) how do i get a faster key input besides getkey()? 2) how do i get the mouse location and stuff? Any of these questions would be appreciated if you answered...
DOS oooh, old...

For the mouse reading, investigate interrupt 0x33 (or 0x31, I can''t remember which because I haven''t programmed in DOS for years). There are a variety of interrupt calls which return data, and a couple to set a custom mouse callback ISR.

For faster keyboard input, investigate interrupt 0x16, or hook into the Keyboard IRQ with a custom hander...

It''s a bit vague I know, but my inclination to remember DOS programming is a little low...

Jans.

-----------------
Janucybermetaltvgothmogbunny
Advertisement
A little trawling across my HD revealed the following DOS mouse hooking code... I''ve only included fragments and have no idea if it works any more; munge it as you see fit.

To initialise:-

    void *tempPointer=NewMouseHandler;void *OldMouseHandler;asm {      xor  ax,ax      int  0x33      les  dx,tempptr      mov  ax,0x0014      mov  cx,tempPointer      int  0x33      mov  ax,es      mov  word ptr [OldMouseHandler],ax      mov  word ptr [OldMouseHandler+2],dx    }[/source]To uninitialise -[source]asm {      les dx, OldMouseHandler      mov ax, 0x0014      int 0x33      mov ax,0x0000      int 0x33    }[/source]Mouse handler: -[source]void far __loadds NewMouseHandler(){    asm {         mov (iMouseAction), ax         mov (iButtons), bx         mov (iMouseX),  cx         mov (iMouseY),  dx        }}    










-----------------
Janucybermetaltvgothmogbunny
You could try inversereality. They''ve got some good tutorials.
==========================================In a team, you either lead, follow or GET OUT OF THE WAY.

This topic is closed to new replies.

Advertisement