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