Solved

Keyboard...

Posted on 1998-05-25
2
187 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Unsigned int64 to unsigned int32 10 1,752
Android Application not running 1 500
Running delphi program with different setting for number format 18 4,818
Inno Setup -> Add App Pin to Task Bar 1 822
After hours on line I found a solution which pointed to the inherited Active Directory permissions . You have to give/allow permissions to the "Exchange trusted subsystem" for the user in the Active Directory...
Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

739 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