You know this thing when you press a key and it appears at once, and when you keep the key pressed there’s a short delay and then the key repeats? That happens on DOS, too, and it’s unsuitable for games. What you want for a game is something like a “key event” (i.e., “key
A
has been pressed now” and “key A
has been released now”). DOS doesn’t provide an API for that.For very simple games, you can ask the BIOS about the state of the Shift, Alt, and Ctrl keys:
https://stanislavs.org/helppc/int_16-2.html
There are individual bits for those keys and you can all tell them apart. I’m pretty sure some games used only this method, for example
TROPFEN
:https://www.youtube.com/watch?v=BYCDJ6W4ySc
You only need to go left or right in this game, or activate a lift. The two Shift keys and Ctrl are used for that. I always wondered why this game uses such weird keys instead of the cursor keys – now I know. 😅
For more elaborate games, you need to write your own handler for hardware IRQ 1. 😀 Then you get to see all the key presses and releases. That’s the method I’m using now.
You know this thing when you press a key and it appears at once, and when you keep the key pressed there’s a short delay and then the key repeats? That happens on DOS, too, and it’s unsuitable for games. What you want for a game is something like a “key event” (i.e., “key
A
has been pressed now” and “key A
has been released now”). DOS doesn’t provide an API for that.For very simple games, you can ask the BIOS about the state of the Shift, Alt, and Ctrl keys:
https://stanislavs.org/helppc/int_16-2.html
There are individual bits for those keys and you can all tell them apart. I’m pretty sure some games used only this method, for example
TROPFEN
:https://www.youtube.com/watch?v=BYCDJ6W4ySc
You only need to go left or right in this game, or activate a lift. The two Shift keys and Ctrl are used for that. I always wondered why this game uses such weird keys instead of the cursor keys – now I know. 😅
For more elaborate games, you need to write your own handler for hardware IRQ 1. 😀 Then you get to see all the key presses and releases. That’s the method I’m using now.
You know this thing when you press a key and it appears at once, and when you keep the key pressed there’s a short delay and then the key repeats? That happens on DOS, too, and it’s unsuitable for games. What you want for a game is something like a “key event” (i.e., “key
A
has been pressed now” and “key A
has been released now”). DOS doesn’t provide an API for that.For very simple games, you can ask the BIOS about the state of the Shift, Alt, and Ctrl keys:
https://stanislavs.org/helppc/int_16-2.html
There are individual bits for those keys and you can all tell them apart. I’m pretty sure some games used only this method, for example
TROPFEN
:https://www.youtube.com/watch?v=BYCDJ6W4ySc
You only need to go left or right in this game, or activate a lift. The two Shift keys and Ctrl are used for that. I always wondered why this game uses such weird keys instead of the cursor keys – now I know. 😅
For more elaborate games, you need to write your own handler for hardware IRQ 1. 😀 Then you get to see all the key presses and releases. That’s the method I’m using now.