Closed venomix666 closed 1 month ago
Yup, that's almost exactly what I was thinking of. One nitpick and the I think it's good to go: can you change the #define names from SCREENARROW... to SCREENKEY..., please? To make it clear that these are keycodes.
Sure, that's a much better naming! Just pushed the commit.
Awesome --- merged. Thanks very much!
I've tested quickly with #Oric and arrow keys work nice for me. But at command prompt they must be filtered and not printed ;).
I wonder how small a proper line editor could be made. The one currently in the BDOS is 219 bytes.
Ah, yes, I thought about filtering for the TTY calls when adding the arrow keys to the translation table, but then I obviously forgot about it :)
Where would be the best place to filter out any characters with the top bit set - in each BIOS where it is necessary or in the BDOS?
In this case, the BDOS, as this is part of the readline command. It should just be as easy as adding a bmi to retry for any character with the top bit set.
In this case, the BDOS, as this is part of the readline command. It should just be as easy as adding a bmi to retry for any character with the top bit set.
Actually, I think I'm wrong here and the (default, BIOS-provided) TTY is a better place. Without a terminal emulator driver installed this is trying to present a lowest-common-denominator ASCII terminal, which means no escape sequences or high-bit characters. It's the CONIN routine which provides the interface between the TTY world and the SCREEN world, so I think this is probably more suitable.
This pull request adds arrow key definitions to the SCREEN driver as discussed in #126, using the BBC Micro character values.
Arrow key support has been added to all SCREEN apps. For qe, I couldn't find a nice way to add the constants defined in screen.h to normal_keys[], so I added them as magic octal numbers.
I also included arrow key translation when using the UART keyboard for the nano6502. For the USB keyboard, I do the translation in hardware.
For the BBC Micro this of course works out of the box, but all other platforms will need BIOS updates to translate the arrow key values.