leostera/minttea

Map more UTF-8 key events

Open

#3 geöffnet am 14. Dez. 2023

Auf GitHub ansehen
 (3 Kommentare) (3 Reaktionen) (0 zugewiesene Personen)OCaml (32 Forks)github user discovery
enhancementgood first issuehelp wanted

Repository-Metriken

Stars
 (462 Stars)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

At the moment we are only handling the space " " and keys in a nice way, but it'd be nice to be able to match on KeyDown Enter or KeyDown "<enter>".

Using a variant for all the keys may be a stretch, since we're parsing UTF-8 grapheme clusters, so at least some common ones we want to handle in a way that lets you match over KeyDown easily.

This is currently happening in the minttea/io_loop.ml in the translate function:

https://github.com/leostera/minttea/blob/main/minttea/io_loop.ml#L18


Currently implemented keys:

  • Enter
  • Space
  • Backspace
  • Left / Down / Up / Right
  • Escape
  • Key (includes a string with the contents of the matched UTF-8 character)

Missing keys:

  • Shift-modifier
  • Ctrl-modifier
  • Alt-modifier
  • ???

Contributor Guide