When the user presses a key in a normal state or in "shift" or "alpha", the key (i.e. the ID of the input key) should be passed to a centralized method, e.g.:
boolean keyInput(String key) {
//1. get token text from perhaps an enum, e.g. "clear memory" -> "ClrMemory"
// if key is invalid (safety test), return false
//2. insert resulting token text in the matrix display at cursor, with possibility to be deleted as a whole and not character by character. (A "span" might help). Return true.
}
When the user presses a key in a normal state or in "shift" or "alpha", the
key
(i.e. the ID of the input key) should be passed to a centralized method, e.g.: