MCPcopy Create free account
hub / github.com/ZDoom/Raze / CT_Responder

Function CT_Responder

source/core/ct_chat.cpp:124–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122//===========================================================================
123
124bool CT_Responder (event_t *ev)
125{
126 if (chatmodeon && ev->type == EV_GUI_Event)
127 {
128 if (ev->subtype == EV_GUI_KeyDown || ev->subtype == EV_GUI_KeyRepeat)
129 {
130 if (ev->data1 == '\r')
131 {
132 ChatQueue.Push(0);
133 ShoveChatStr ((char *)ChatQueue.Data(), chatmodeon - 1);
134 ChatQueue.Pop();
135 CT_Stop ();
136 return true;
137 }
138 else if (ev->data1 == GK_ESCAPE)
139 {
140 CT_Stop ();
141 return true;
142 }
143 else if (ev->data1 == '\b')
144 {
145 CT_BackSpace ();
146 return true;
147 }
148#ifdef __APPLE__
149 else if (ev->data1 == 'C' && (ev->data3 & GKM_META))
150#else // !__APPLE__
151 else if (ev->data1 == 'C' && (ev->data3 & GKM_CTRL))
152#endif // __APPLE__
153 {
154 ChatQueue.Push(0);
155 I_PutInClipboard ((char *)ChatQueue.Data());
156 ChatQueue.Pop();
157 return true;
158 }
159#ifdef __APPLE__
160 else if (ev->data1 == 'V' && (ev->data3 & GKM_META))
161#else // !__APPLE__
162 else if (ev->data1 == 'V' && (ev->data3 & GKM_CTRL))
163#endif // __APPLE__
164 {
165 CT_PasteChat(I_GetFromClipboard(false).GetChars());
166 }
167 }
168 else if (ev->subtype == EV_GUI_Char)
169 {
170 // send a macro
171 if (ev->data2 && (ev->data1 >= '0' && ev->data1 <= '9'))
172 {
173 ShoveChatStr (*CombatMacros[ev->data1 - '0'], chatmodeon - 1);
174 CT_Stop ();
175 }
176 else
177 {
178 CT_AddChar (ev->data1);
179 }
180 return true;
181 }

Callers 1

G_ResponderFunction · 0.85

Calls 11

ShoveChatStrFunction · 0.85
CT_StopFunction · 0.85
CT_BackSpaceFunction · 0.85
CT_PasteChatFunction · 0.85
CT_AddCharFunction · 0.85
PopMethod · 0.80
I_PutInClipboardFunction · 0.50
I_GetFromClipboardFunction · 0.50
PushMethod · 0.45
DataMethod · 0.45
GetCharsMethod · 0.45

Tested by

no test coverage detected