MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / enable

Method enable

Engine/source/platformPOSIX/POSIXConsole.cpp:86–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86void StdConsole::enable(bool enabled)
87{
88 if (enabled && !stdConsoleEnabled)
89 {
90 stdConsoleEnabled = true;
91
92 // install signal handler for sigcont
93 signal(SIGCONT, &signalHandler);
94
95 // save the terminal state
96 if (originalTermState == NULL)
97 originalTermState = new termios;
98
99 tcgetattr(stdIn, originalTermState);
100
101 // put the terminal into our preferred mode
102 resetTerminal();
103
104 printf("%s", Con::getVariable("Con::Prompt"));
105
106 }
107 else if (!enabled && stdConsoleEnabled)
108 {
109 stdConsoleEnabled = false;
110
111 // uninstall signal handler
112 signal(SIGCONT, SIG_DFL);
113
114 // reset the original terminal state
115 if (originalTermState != NULL)
116 tcsetattr(stdIn, TCSANOW, originalTermState);
117 }
118}
119
120void StdConsole::enableInput( bool enabled )
121{

Callers 3

initMethod · 0.45
DefineEngineFunctionFunction · 0.45
destroyMethod · 0.45

Calls 2

printfFunction · 0.85
getVariableFunction · 0.85

Tested by

no test coverage detected