MCPcopy Create free account
hub / github.com/diasurgical/devilution / control_presskeys

Function control_presskeys

Source/control.cpp:2160–2191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2158}
2159
2160BOOL control_presskeys(int vkey)
2161{
2162 int len;
2163 BOOL ret;
2164
2165 if (gbMaxPlayers != 1) {
2166 if (!talkflag) {
2167 ret = FALSE;
2168 } else {
2169 if (vkey == VK_SPACE) {
2170 } else if (vkey == VK_ESCAPE) {
2171 control_reset_talk();
2172 } else if (vkey == VK_RETURN) {
2173 control_press_enter();
2174 } else if (vkey == VK_BACK) {
2175 len = strlen(sgszTalkMsg);
2176 if (len > 0)
2177 sgszTalkMsg[len - 1] = '\0';
2178 } else if (vkey == VK_DOWN) {
2179 control_up_down(1);
2180 } else if (vkey == VK_UP) {
2181 control_up_down(-1);
2182 } else {
2183 return FALSE;
2184 }
2185 ret = TRUE;
2186 }
2187 } else {
2188 ret = FALSE;
2189 }
2190 return ret;
2191}
2192
2193void control_press_enter()
2194{

Callers 1

PressKeyFunction · 0.85

Calls 3

control_reset_talkFunction · 0.85
control_press_enterFunction · 0.85
control_up_downFunction · 0.85

Tested by

no test coverage detected