If you pressed one of the joystick buttons on the TRS-80 Color Computer while running BASIC, it would act as if
@ABCDEFG were typed. Pressing the other joystick button would similarly type out
HIJKLMNO. Why did the CoCo exhibit this behavior?
On the Color Computer, I/O address &FF00 is used for both the joysticks and the keyboard row input. Bits 0/1 are toggled by the two joystick port buttons, and these bits are the same as rows 1/2 for the keyboard.
BASIC continually scans for keyboard input by looking at &FF00 (for the row) and &FF02 (for the column). Since &FF02 will not indicate a keypress, BASIC interprets the toggling of rows 1/2, caused by the joystick button, as pressing all 8 of the keys for all 8 columns.
The fewer kinds of input a computer has to deal with, the easier its life is. This applies equally to physical ports and to the provisions for input in the BIOS and operating system generally. Abolishing “joystick button input” as a separate category makes everything much simpler.
The same applies to function keys on keyboards (such as the arrow keys). Rather than sending unique, presumably non-ASCII characters of their own, they can send escape sequences just as if they had been typed.
There are two possible approaches. One is to make the buttons send a sequence of keystrokes which the user is unlikely to type, or unlikely to type that fast. The other is to make them programmable so that they send whatever they have been programmed to send. I don’t know which way your particular joystick was designed.