I'm working on a game that I would like to allow for three input methods.
1) Joystick
2) Mouse
3) Keyboard
The first two don't really present much of a problem, but I need a method
for intercepting multiple keystrokes, ie, the user users the up arrow key
to move and hits the spacebar to fire his weapon at the same time. Can
anyone here offer me any advice. I'm not sure how to do this under
intuition, and was thinking of using interupts instead, but I haven't used
them before on the Amiga.
Any ideas out there?
Gary
Gary,
Open the console.device in library mode. Use IDCMP_RAWKEY. You will get a
message for each key when it is pressed, and another one, when it is
released. Filter out the special keys you want to monitor.
If some alpha key is pressed, let the console device translate it for you
to ASCII with it's function RawKeyConvert(), which will take care of the
keyboard preferences the user has chosen.
Looks simple, but it's a hard piece of work to implement and test.
– wkc – … via AP from Hamburg, Germany