leostera / leostera/minttea

Map more UTF-8 key events

Open
#3 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue help wanted
Dominant language
OCaml
Stars
472
Forks
32
PR merge metrics
No merged PRs in 30d

Description

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

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in minttea/io_loop.ml at the translate function and inspect how the currently implemented key events are represented and matched. Compare the existing Enter, Space, Backspace, arrow, Escape, and UTF-8 key handling with the missing modifier cases. Done means the intended common key and modifier events can be matched consistently, with tests covering the added mappings.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.