ARGSUSED */
| 264 | |
| 265 | /* ARGSUSED */ |
| 266 | void |
| 267 | gend_key(Widget w, XEvent *event, String *params, Cardinal *num_params) |
| 268 | { |
| 269 | char ch, *mark; |
| 270 | static char gendchars[] = "mf"; |
| 271 | |
| 272 | nhUse(w); |
| 273 | nhUse(params); |
| 274 | nhUse(num_params); |
| 275 | |
| 276 | ch = key_event_to_char((XKeyEvent *) event); |
| 277 | if (ch == '\0') { /* don't accept nul char/modifier event */ |
| 278 | /* don't beep */ |
| 279 | return; |
| 280 | } |
| 281 | mark = strchr(gendchars, ch); |
| 282 | if (!mark) |
| 283 | mark = strchr(gendchars, lowc(ch)); |
| 284 | if (!mark) { |
| 285 | if (strchr(ps_randchars, ch)) |
| 286 | ps_selected = PS_RANDOM; |
| 287 | else if (strchr(ps_quitchars, ch)) |
| 288 | ps_selected = PS_QUIT; |
| 289 | else { |
| 290 | X11_nhbell(); /* no such gender */ |
| 291 | return; |
| 292 | } |
| 293 | } else |
| 294 | ps_selected = (int) (mark - gendchars); |
| 295 | exit_x_event = TRUE; |
| 296 | } |
| 297 | |
| 298 | /* ARGSUSED */ |
| 299 | void |
nothing calls this directly
no test coverage detected