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

Function Dia_Handler

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

Source from the content-addressed store, hash-verified

3023#define Dia_Init K_Init
3024
3025int
3026Dia_Handler(xev)
3027XEVENT *xev;
3028{
3029 int ev = xev->ev_mwich;
3030 char ch = (char) (xev->ev_mkreturn & 0x00FF);
3031
3032 if (ev & MU_KEYBD) {
3033 WIN *w;
3034 DIAINFO *dinf;
3035
3036 switch (ch) {
3037 case 's':
3038 send_key((int) (mar_iflags_numpad() ? '5' : '.'));
3039 break;
3040 case '.':
3041 send_key('5'); /* MAR -- '.' is a button if numpad isn't set */
3042 break;
3043 case '\033': /*ESC*/
3044 if ((w = get_top_window()) && (dinf = (DIAINFO *) w->dialog)
3045 && dinf->di_tree == zz_oblist[DIRECTION]) {
3046 my_close_dialog(dinf, FALSE);
3047 break;
3048 }
3049 /* Fall thru */
3050 default:
3051 ev &= ~MU_KEYBD; /* let the dialog handle it */
3052 break;
3053 }
3054 }
3055 return (ev);
3056}
3057
3058int
3059mar_ask_direction()

Callers

nothing calls this directly

Calls 3

send_keyFunction · 0.85
mar_iflags_numpadFunction · 0.85
my_close_dialogFunction · 0.85

Tested by

no test coverage detected