SCNKEY
not suitable for games that require several simultaneous key entries. He is stateless and simply returns the "key" that is now pressed, i.e. If two are pressed, he will tell you only one and does not officially give any guarantees as to which one. The best thing you could do is to consider pressing a key until SCNKEY
reports that something has not been pressed yet, or that nothing is happening, but there would also be a chance that the second simultaneous keystroke is ignored or replaces the first.
If your program doesnโt correspond to orthodoxy there just by pressing the "the" key, you will have to hit the hardware yourself. Codebase64 offers sample code ; my consolidated version (the CIA is correctly configured, although it is likely to be configured accordingly):
- write a byte to DC00 that contains 0 for each line that you want to scan at the same time;
- read the byte from DC01 and check the upper four bits to find out which keys were pressed on the selected lines.
The general procedure is to check each line separately to avoid shadowing - suppose you asked to read lines 4 and 5 at the same time, storing 0s to DC00 in bits 3 and 4, and the result you got back had the upper bit, you don't know whether v or n or both were pressed, only at least one of them.
Look at the very bottom of the same link as above, the table of rows and columns on the English keyboard; they are the result of the physical layout of the keys, so other languages โโwill change as much as their keyboard. If you are writing a game and you are more interested in the layout of the keys than their characters, you do not need to worry about the language.
Tommy source share