boolean HUlib_keyInIText(hu_itext_t* it, unsigned char ch) { if (ch >= ' ' && ch <= '_') HUlib_addCharToTextLine(&it->l, (char) ch); else if (ch == key_backspace) // phares HUlib_delCharFromIText(it); else if (ch != key_enter) // phares return false; // did not eat key return true; // ate the key }
// wrapper function for handling general keyed input. // returns true if it ate the key boolean HUlib_keyInIText ( hu_itext_t* it, unsigned char ch ) { if (ch >= ' ' && ch <= '_') HUlib_addCharToTextLine(&it->l, (char) ch); else if (ch == KEY_BACKSPACE) HUlib_delCharFromIText(it); else if (ch != KEY_ENTER) return false; // did not eat key return true; // ate the key }