38 if (event.type == ALLEGRO_EVENT_KEY_CHAR) {
39 if (event.keyboard.unichar >= 32) {
40 al_ustr_append_chr(str, event.keyboard.unichar);
42 }
else if (event.keyboard.keycode == ALLEGRO_KEY_BACKSPACE) {
43 int pos = (int)al_ustr_size(str);
44 if (al_ustr_prev(str, &pos))
45 al_ustr_truncate(str, pos);