19 if (event.type == ALLEGRO_EVENT_KEY_CHAR) {
20 if (event.keyboard.unichar >= 32) {
21 al_ustr_append_chr(str, event.keyboard.unichar);
23 }
else if (event.keyboard.keycode == ALLEGRO_KEY_BACKSPACE) {
24 int pos = (int)al_ustr_size(str);
25 if (al_ustr_prev(str, &pos))
26 al_ustr_truncate(str, pos);