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

Function curses_nh_poskey

win/curses/cursmain.c:1087–1104  ·  view source on GitHub ↗

int nh_poskey(coordxy *x, coordxy *y, int *mod) -- Returns a single character input from the user or a a positioning event (perhaps from a mouse). If the return value is non-zero, a character was typed, else, a position in the MAP window is returned in x, y and mod. mod may be one of

Source from the content-addressed store, hash-verified

1085 routine always returns a non-zero character.
1086*/
1087int
1088curses_nh_poskey(coordxy *x, coordxy *y, int *mod)
1089{
1090 int key = curses_nhgetch();
1091
1092#ifdef NCURSES_MOUSE_VERSION
1093 /* Mouse event if mouse_support is true */
1094 if (key == KEY_MOUSE) {
1095 key = curses_get_mouse(x, y, mod);
1096 }
1097#else
1098 nhUse(x);
1099 nhUse(y);
1100 nhUse(mod);
1101#endif
1102
1103 return key;
1104}
1105
1106/*
1107nhbell() -- Beep at user. [This will exist at least until sounds are

Callers

nothing calls this directly

Calls 2

curses_nhgetchFunction · 0.85
curses_get_mouseFunction · 0.85

Tested by

no test coverage detected