returns the text for a one-byte encoding; * must be shorter than a tab for proper formatting */
| 3222 | /* returns the text for a one-byte encoding; |
| 3223 | * must be shorter than a tab for proper formatting */ |
| 3224 | char * |
| 3225 | key2txt(uchar c, char *txt) /* sufficiently long buffer */ |
| 3226 | { |
| 3227 | /* should probably switch to "SPC", "ESC", "RET" |
| 3228 | since nethack's documentation uses ESC for <escape> */ |
| 3229 | if (c == ' ') |
| 3230 | Sprintf(txt, "<space>"); |
| 3231 | else if (c == '\033') |
| 3232 | Sprintf(txt, "<esc>"); /* "<escape>" won't fit */ |
| 3233 | else if (c == '\n') |
| 3234 | Sprintf(txt, "<enter>"); /* "<return>" won't fit */ |
| 3235 | else if (c == '\177') |
| 3236 | Sprintf(txt, "<del>"); /* "<delete>" won't fit */ |
| 3237 | else |
| 3238 | Strcpy(txt, visctrl((char) c)); |
| 3239 | return txt; |
| 3240 | } |
| 3241 | |
| 3242 | |
| 3243 | void |
no test coverage detected