Apple II computers other than the IIgs (which uses ADB) have a hardwired keyboard combined with the paddle/joystick ports for input. What combinations of modifier keys can you detect? I know that the paddle/joystick buttons are considered part of the keyboard so those count towards the combinations as well. For example could you detect open-apple + closed-apple + shift + alpha-numerical key. What about joystick button-one + open-apple + alpha-numerical key.
The Apple II descends directly from the Apple I and other similar home-built micros of the era in its handling of the keyboard: there is an address from which you can query whether a new keystroke has been received. If it has been received, it is the appropriate code for whatever was pressed — if you pressed 'a' then it'll have an 'a' in it; if you pressed shift+'a' then it'll have an 'A' in it. There's no inherent way to read the current state of any of the modifiers, or indeed any of the keys.
Compare and contrast with later 8-bit micros, which usually scan a keyboard matrix in software, and with any computer with a serial keyboard bus, such as ADB, which will receive key up and key down notifications.
Later models of the Apple II modify this behaviour. They:
- codify the commonly-performed shift-key modification. That additionally connects the shift key to the third joystick button; and
- as of the IIe, the open and closed Apple keys are added, connected to the other two joystick buttons.
- joystick buttons are considered part of the keyboard only in the sense that they were reprovisioned to provide additional keyboard input after the fact;
- if you have an unmodified pre-IIe Apple II you cannot detect the current state of any of the modifiers;
- a common modification to the pre-IIe machines maps shift to the third joystick button. That's in addition to the actual third joystick button, if you had one. Those two things cannot be disambiguated;
- from the IIe onwards, the open and closed Apple keys are added and similarly report on the other joystick buttons (open Apple = the first button, closed Apple = the second). But cannot be disambiguated from the actual joystick buttons.
The state of the open-Apple, closed-Apple, and--on machines with the "shift key mod"--shift key can be read at any time, independently from any other keypress. Additionally, on the Apple //e, but not earlier models, it is possible to determine whether all non-modifier keys are released at any moment in time. Nothing in the hardware will record the state of modifier keys at the moment a key is pushed, except in cases where the modifier affects the key code produced. If, for example, while the computer is busy one types a key and then presses and holds the open-Apple when the computer finishes what it was doing, it would have no way of determining that open-Apple was not pressed at the time you typed the character.