Open mrdude2478 opened 1 year ago
Never Mind, I found the problem - this fixes it and now touchscreen works with this modded code:
void IN_Touch( void ) {
//set up touchscreen
hidInitializeTouchScreen();
}
void IN_ProcessTouch( void )
{
HidTouchScreenState state={0};
if (hidGetTouchScreenStates(&state, 1)) {
if (state.count != prev_touchcount)
{
prev_touchcount = state.count;
}
for(int i=0; i<state.count; i++)
{
SDL_WarpMouseInWindow(SDL_window, (state.touches[i].x/3)*2, (state.touches[i].y/3)*2);
}
}
}
Thanks anyway.
Can you please let me know in sdl_input_nx. I am trying to add mouse touchsceen for navigating menu's. I have already innitialised touchscreen in a different function: hidInitializeTouchScreen(); In this function, the cursor moves around the screen, but for some reason the calculations are wrong and the more you drag the cursor to the right edge of the screen the further out of sink it goes.
Can you see what I have done wrong in this code?