Hi!
I have an idea: programming Text Editor which use CRSR L/R, CRSR U/D to move cursor and arrows on the line of function keys UP, DOWN, LEFT, RIGHT to do like L=Home, R=End, U=Page up, D=Page Down.
I tried to read codes in Basic, but they were the same CRSR and ARROWS...
Can I recognize that CRSR or ARROW was pressed?
Thanks for all.
Miro
How did you use BASIC to read which key is being pressed?
If you PEEK address 212 it will show the values 83, 84, 85 and 86 (from left to right) for the arrow keys in the function keys row. The CRSR keys will show the value 7 for the up/down key and 2 for the left/right key.
If you want to see if shift is being pressed in order to determine if the cursor should go up or down when the CRSR up/down key is being pressed (or left or right when the CRSR left/right key is being pressed), read address 211. It will be 1 if shift is being pressed.
Quote from: Mapping the Commodore 128 (regarding address 211)
The values found in that location are as follows:
No shift key pressed | 0 |
SHIFT | 1 |
Commodore | 2 |
Control | 4 |
ALT | 8 |
CAPS LOCK | 16 |
For this location the values are cumulative. If you press both SHIFT and CONTROL, the location will contain 1 + 4 = 5. Holding down SHIFT, CONTROL, Commodore, and ALT together results in a value of 15.
Mapping the C128 can be found here (http://commodore128.org.uk/books/Mapping_the_Commodore_128.pdf).