Keyboard joystick emulation question

By mi-chi

Scribe (25)

mi-chi's picture

17-08-2022, 23:55

I'm currently playing around with hot-switching between mouse, keyboard and joystick controls in a game and found a surprising behavior when simulating a joystick using the option "keyjoystick1" (or ...2) via keyboard, which I didn't expect:

As I understood, this maps the cursor keys of the host to the joystick in port 1 (or 2). Reading the stick info via BASIC, BIOS or directly from the PSG port works as expected. However, and this is what I didn't expect, that option seems to additionally fill the keyboard buffer with the corresponding ASCII-codes of the pressed cursor key up/down/left/right.

I can think of good reasons why it was made that way, and - yes - using a real USB joystick or gamepad does work, but out of curiosity:
Is there a way to emulate a joystick with the (host) keyboard without also having the host keys being sensed as pressed?

Login or register to post comments