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

Function tgetch

sys/msdos/msdos.c:64–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62#endif
63
64int
65tgetch(void)
66{
67 char ch;
68
69#ifdef SCREEN_VESA
70 if (iflags.usevesa) {
71 vesa_flush_text();
72 }
73#endif /*SCREEN_VESA*/
74/* BIOSgetch can use the numeric key pad on IBM compatibles. */
75#ifdef SIMULATE_CURSOR
76 if (iflags.grmode && cursor_flag)
77 DrawCursor();
78#endif
79 if (iflags.BIOS)
80 ch = BIOSgetch();
81 else
82 ch = DOSgetch();
83#ifdef SIMULATE_CURSOR
84 if (iflags.grmode && cursor_flag)
85 HideCursor();
86#endif
87 return ((ch == '\r') ? '\n' : ch);
88}
89
90/*
91 * Keyboard translation tables.

Callers 1

tty_nhgetchFunction · 0.50

Calls 5

vesa_flush_textFunction · 0.85
DrawCursorFunction · 0.85
HideCursorFunction · 0.85
DOSgetchFunction · 0.70
BIOSgetchFunction · 0.50

Tested by

no test coverage detected