I'm trying to make a Word Processor using the USB Shield + library r2.0, with Max_LCD driving a 4 x 20 HD44780 screen on the GPOUT pins. Right now I can type keys on the keyboard and they're written sequentially to it's memory (line 1, line 3, line 2, then line 4, repeat.)
What I'd like to develop, or graciously steal / port from existing code, is a library for editing a text buffer, moving a cursor around, and rendering it to the LCD - even if the dimensions of the text window are larger than what the screen can display at one time.
Given that there are a bunch
of cheap word processors out there that pretty much do the same thing, I figure someone has to have written something similar before.
Features I'm hoping to implement:
- Write text using keyboard into a buffer;
- Inserting or deleting shifts the characters in the buffer (given the speed of Arduino, should I use a 'gap buffer' strategy?)
- Render text document (say, 80 cols x 25 lines) to whatever size screen is being used - 1, 2 or 4 lines; 16, 20, 40 or 80 columns, etc.)
- Navigate around the virtual text document using arrow keys, modifier keys to jump by word, or home/end, pgup/dn.
- Shift-select text; invert selected text; cut, copy and paste
- Special control combos to display onscreen help, show how much memory is available, etc.
- Auto scroll while typing or navigating; word wrap text to virtual window size.
If memory becomes an issue I can use a board with more onboard RAM.
I will post a followup to this with some projects and libraries I found that are somewhat similar.
Your thoughts & advice would be much appreciated!