MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / Input_SetPressed

Function Input_SetPressed

src/Input.c:214–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212};
213
214void Input_SetPressed(int key) {
215 cc_bool wasPressed = Input.Pressed[key];
216 Input.Pressed[key] = true;
217
218 if (key <= CCMOUSE_M) Event_RaiseInput(&InputEvents._down, key, wasPressed, &NormDevice);
219 Event_RaiseInput(&InputEvents.Down2, key, wasPressed, &NormDevice);
220
221 if (key == 'C' && Input_IsActionPressed()) Event_RaiseInput(&InputEvents.Down2, INPUT_CLIPBOARD_COPY, 0, &NormDevice);
222 if (key == 'V' && Input_IsActionPressed()) Event_RaiseInput(&InputEvents.Down2, INPUT_CLIPBOARD_PASTE, 0, &NormDevice);
223
224 /* don't allow multiple left mouse down events */
225 if (key != CCMOUSE_L || wasPressed) return;
226 Pointer_SetPressed(0, true);
227}
228
229void Input_SetReleased(int key) {
230 if (!Input.Pressed[key]) return;

Callers 15

ClientWndProcFunction · 0.85
Input_SetFunction · 0.85
Input_SetNonRepeatableFunction · 0.85
Mouse_ScrollVWheelFunction · 0.85
Mouse_ScrollHWheelFunction · 0.85
HandleButtonPressFunction · 0.85
HandleKeyPressFunction · 0.85
KeyEventProcFunction · 0.85
ProcessKeyFunction · 0.85
HandleMouseDownFunction · 0.85
HandleKeyDownFunction · 0.85

Calls 2

Event_RaiseInputFunction · 0.85
Pointer_SetPressedFunction · 0.85

Tested by

no test coverage detected