diff --git a/src/system.c b/src/system.c index 90eda86..fb20722 100644 --- a/src/system.c +++ b/src/system.c @@ -67,6 +67,11 @@ static struct bool state[tic_keys_count]; + struct + { + bool state[tic_keys_count]; + } touch; + } keyboard; u32 touchCounter; @@ -419,7 +424,7 @@ static void processKeyboard() enum{BufSize = COUNT_OF(input->keyboard.keys)}; for(s32 i = 0, c = 0; i < COUNT_OF(platform.keyboard.state) && c < BufSize; i++) - if(platform.keyboard.state[i]) + if(platform.keyboard.state[i] || platform.keyboard.touch.state[i]) input->keyboard.keys[c++] = i; } @@ -499,6 +504,8 @@ static void processTouchKeyboard() enum {BufSize = COUNT_OF(input->keyboard.keys)}; + SDL_memset(&platform.keyboard.touch.state, 0, sizeof platform.keyboard.touch.state); + for (s32 i = 0; i < devices; i++) { SDL_TouchID id = SDL_GetTouchDevice(i);