[Tool]PokiPad text editor + onscreen keyboard

I’ve split my recent work into two posts: this one and LILIDE.


PokiPad is a plaintext editor for Pokitto.

Untitled-1

It’s a basic program that tries to imitate the simplest text editors you find on most operating systems. However, it should be quite easy to extend and add functionality if you want to shape it to your liking (one example is LILIDE that I’ve made based on this) – just make it whatever you want.

Along with the program I made a few other reusable modules you can make use of. These include an onscreen keyboard along with related text handling and rendering classes (keyboard.hpp), ASCIIfying library and an extension of PokiPad (LILIDE).

The current PokiPad features are:

  • Editing long multiline plain ASCII text in a way you’re used to (cursor movement, backspace, delete, …).
  • Basic operations you know from text editors: selecting, copying, pasting, searching.
  • Advanced onscreen keyboard with all printable ASCII characters, multiple layouts, and hotkeys for “fast and comfortable” typing.
  • Opening and saving files from/to SD card.
  • Tabs.
  • Themes.
  • Document stats (number of characters, words, …).

And its limitations are:

  • You can only have one file open (no tabs).
  • You can only edit a file to a maximum size of 10 kB (not KiB), in order to FIT in the RAM. You can open a bigger file, but it will be truncated (you’ll be warned about this).
  • You can only open and save files to the root of the SD card, not subfolders.
  • There is no undo. It was planned, but I scratched it for the base version as it’s not that easy to implement.
  • The program only works with ASCII (7 bit) encoded files. You can open files in some other encodings, such as UTF-8, but it’ll be converted to an ASCII approximation and you may lose information this way.
  • The configuration (theme, keyboard layout, …) is currently not saved to EEPROM.
  • There are no scrollbars (but there is an infobar telling you the column and row position).
  • With a cursor placed on a line that has tabs before the cursor may cause non-optimal view placement (the screen may not align with the cursor correctly). It’s because within the current framework computing the actual cursor position can’t be done quickly because tabs’ width depends on their position, so the cursor position is only estimated.

The controls are as follows (feels quite natural once you get used to it, trust me):

  • Use arrows to select a keyboard key.
  • A to type the key.
  • Navigate to bottom right to open the menu.
  • To switch a keyboard page (lowecase/uppercase, …) there is a special key on the keyboard, next to the arrows.
  • Hotkeys:
    • B + arrows (all four): move cursor
    • B + A (swipe right): delete
    • B + C (swipe left): backspace
    • C + A: switch keyboard page
    • C + up: space
    • C + down: shift (turn selection mode on/off)

WARNING: back up your SD card if you value the content! The Pokitto SD card library I used is a WIP and has bugs. I may also have bugs in my code. It is therefore not impossible your files will get corrupted and/or lost.

Also: some SD cards may not work with this program. I experienced this with my own card – it’s an issue with the SD library. At the moment you can do nothing but switch to another card.

This program is free software released under CC0 1.0 waiver, which means it is in the public domain and you can do absolutely anything with it (including commercial use) without any burden (including giving me credit). If you like the program and want to thank me, the best way is to share your own software as free and open source as well, using an appropriate license.

Here is the code and the binary:

pokipad.bin (126.8 KB)

5 Likes

As per usual with your posts -> :scream:

:+1::sunglasses:

3 Likes

Now comes the favourite part of my day:

I finally get to try all the new stuff that’s been made today! :wink:

And @drummyfish … there’s a badge coming for this. I need to think of something funny.

EDIT: as for @FManga 's badges, I’ve all but given up, because I cant think of anything extreme enough … oh wait… no… now I have an idea :wink:

3 Likes

@drummyfish

tenor

First I was like “text editor…? That’ll never work”

Now I’m like holy crap. It’s actually usable

Edit.

Time for Zork

4 Likes

Why not just “The @FManga badge, awarded to @FManga for being @FManga”?

3 Likes

Hmmm I really think we should port a text adventure, it should be a piece of cake. Collosal Cave Adventure is BSD licensed (I haven’t played it but it has a documentary made about, so I suppose it’s good). Zork is proprietary I suppose? Any other candidates? I have to make a deeper research when I come home.

2 Likes

I just finished a text adventure game for my final CS 1300 project but I’m going to wait until the end of the semester to open-source it to prevent being accused of plagiarizing myself. Will definitely be on Github around 3 weeks from now though. It’s sort of Oregon Trail with turn-based combat and a fantasy setting.

EDIT: That would also mean it would be another original IP which could be pretty cool

EDIT 2: Actually I can’t open-source it since if someone else steals it I could be accused of an honor code violation which I don’t want to happen. I can release an EXE though and we could try to recreate it.

4 Likes