MCPcopy Index your code
hub / github.com/NetHack/NetHack / CtrlHandler

Function CtrlHandler

sys/windows/consoletty.c:997–1020  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

995}
996
997static BOOL
998CtrlHandler(DWORD ctrltype)
999{
1000 switch (ctrltype) {
1001 /* case CTRL_C_EVENT: */
1002 case CTRL_BREAK_EVENT:
1003 term_clear_screen();
1004 FALLTHROUGH;
1005 /* FALLTHRU */
1006 case CTRL_CLOSE_EVENT:
1007 case CTRL_LOGOFF_EVENT:
1008 case CTRL_SHUTDOWN_EVENT:
1009 getreturn_enabled = FALSE;
1010#ifndef NOSAVEONHANGUP
1011 hangup(0);
1012#endif
1013#if defined(SAFERHANGUP)
1014 CloseHandle(console.hConIn); /* trigger WAIT_FAILED */
1015 return TRUE;
1016#endif
1017 default:
1018 return FALSE;
1019 }
1020}
1021
1022/* called by pcmain() and process_options() */
1023void

Callers

nothing calls this directly

Calls 2

hangupFunction · 0.85
term_clear_screenFunction · 0.70

Tested by

no test coverage detected