Solved

Keyboard...

Posted on 1998-05-25
2
172 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Twsocket as Twsocketserver 6 1,630
Get pixel color of a jpg in a TImage 1 2,609
copy one tchart to another 1 522
Virtualstringtree carsh after invalidate for while 5 87
What does UTC stand for?  “Coordinated Universal Time” – Think of this as the true time on Planet Earth that never changes with the exception of minor leap seconds here and there to account for the changes in the planet's rotation.   What does th…
There are many Password Managers (PM) out there to choose from. PM's can help with your password habits and routines, but they should not be a crutch you rely on too heavily. I also have an article for company/enterprise PM's.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

867 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now