Solved

Keyboard...

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

744 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

11 Experts available now in Live!

Get 1:1 Help Now