Solved

Keyboard...

Posted on 1998-05-25
2
181 Views
Last Modified: 2011-10-03
I'm makeing a game where I have to move around human with arrow keys. When I change
the direction the human stops for a short time. I have tried with port $60 but it is still the same.
The value in buffer remains the same and after a short time it changes. But I want to get the
value of the button when I press it.
Please help me.
0
Comment
Question by:ssdjgru1
2 Comments
 
LVL 2

Accepted Solution

by:
kellyjj earned 200 total points
ID: 1217038
Here is some assembler code that will do what you want:

      asm
      begin
            mov ax,0;
            mov ah,0x10;
            int 16h;
            mov key_char,al;
            mov extn_char,ah;
      end;

You will want to first check to make sure a a key was pressed  ( by calling the boolean func  keypressed  )  then you call this code.  You shoud be able to put this inside a procedure.   This will remove the key pressed from the buffer.  Note:  if no key has been pressed and this code gets called it will just sit there waiting for a key to be pressed.  I hope this helps

0
 

Author Comment

by:ssdjgru1
ID: 1217039
Thanx for the code man... it works :))
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The business world is becoming increasingly integrated with tech. It’s not just for a select few anymore — but what about if you have a small business? It may be easier than you think to integrate technology into your small business, and it’s likely…
The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question