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

Function ProcessTouchInput

src/switch/Window_Switch.c:108–119  ·  view source on GitHub ↗

#######################################################################################################################* *----------------------------------------------------Input processing-----------------------------------------------------* *#########################################################################################################################*/

Source from the content-addressed store, hash-verified

106*----------------------------------------------------Input processing-----------------------------------------------------*
107*#########################################################################################################################*/
108static void ProcessTouchInput(void) {
109 static int prev_touchcount = 0;
110 HidTouchScreenState state = { 0 };
111 hidGetTouchScreenStates(&state, 1);
112
113 if (state.count) {
114 Input_AddTouch(0, state.touches[0].x, state.touches[0].y);
115 } else if (prev_touchcount) {
116 Input_RemoveTouch(0, Pointers[0].x, Pointers[0].y);
117 }
118 prev_touchcount = state.count;
119}
120
121void Window_ProcessEvents(float delta) {
122 // Scan the gamepad. This should be done once for each frame

Callers 1

Window_ProcessEventsFunction · 0.70

Calls 2

Input_AddTouchFunction · 0.85
Input_RemoveTouchFunction · 0.85

Tested by

no test coverage detected