MCPcopy Create free account
hub / github.com/NetHack/NetHack / single_handler

Function single_handler

outdated/win/gem/wingem1.c:3121–3149  ·  view source on GitHub ↗
(xev)

Source from the content-addressed store, hash-verified

3119#define single_init K_Init
3120
3121static int
3122single_handler(xev)
3123XEVENT *xev;
3124{
3125 int ev = xev->ev_mwich;
3126
3127 if (ev & MU_KEYBD) {
3128 char ch = (char) xev->ev_mkreturn & 0x00FF;
3129 WIN *w;
3130 DIAINFO *dinf;
3131
3132 switch (ch) {
3133 case ' ':
3134 send_return();
3135 break;
3136 case '\033':
3137 if ((w = get_top_window()) && (dinf = (DIAINFO *) w->dialog)
3138 && dinf->di_tree == zz_oblist[YNCHOICE]) {
3139 if (!send_yn_esc(FAIL))
3140 my_close_dialog(dinf, FALSE);
3141 break;
3142 }
3143 /* Fall thru */
3144 default:
3145 ev &= ~MU_MESAG;
3146 }
3147 }
3148 return (ev);
3149}
3150
3151char
3152Gem_yn_function(query, resp, def)

Callers

nothing calls this directly

Calls 3

send_returnFunction · 0.85
send_yn_escFunction · 0.85
my_close_dialogFunction · 0.85

Tested by

no test coverage detected