Getting a keypress without waiting for the key to be released

Joined
Jan 1, 2025
Messages
8
Reaction score
0
I'm writing a game clone (pac man) and everything runs fine until the user holds down one of the arrow keys. My code is

if keypressed then ch := readkey; (readkey gets the character from the buffer)

I'm not sure if its the keypressed call or the readkey that freezes things until the key is released. Is there an interrupt than can be used (in line assembly) to get the keypressed character without waiting for the key to be released?
 
Joined
Sep 21, 2022
Messages
208
Reaction score
28
I used to have a book called DOS programming: the complete reference by Kris Jamsa. Your answer is in there.

Threw it away many years ago, along with all my other manuals. I figured that if I needed some esoteric fact, I could look it up online.

That was a different internet. Few adverts and no subscriptions.

The modern world wide web is a big *&%!!$ disappointment to me.

Oh well, live and learn.
 
Joined
Jan 1, 2025
Messages
8
Reaction score
0
I used to have a book called DOS programming: the complete reference by Kris Jamsa. Your answer is in there.

Threw it away many years ago, along with all my other manuals. I figured that if I needed some esoteric fact, I could look it up online.

That was a different internet. Few adverts and no subscriptions.

The modern world wide web is a big *&%!!$ disappointment to me.

Oh well, live and learn.
Ok, thanks. Here's some videos of the clones I've been working on. None are finished yet.

Space invaders:

Pacman


Centipeed:

 
Joined
Sep 21, 2022
Messages
208
Reaction score
28
I was a big fan of line graphics. The only game I wrote was a 2d space game with very minimal shapes, but the movement was smooth.

The game started out as a simple "my ship versus the program's fleet" game.

The game went through many versions over time. When I won, I gave it better smarter ships. When it won, I found its weakness, or gave myself better equipment. Around and around I went.

In a way I was playing both sides. Modifying the game was more fun than playing it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,129
Messages
2,570,770
Members
47,329
Latest member
FidelRauch

Latest Threads

Top