Updated raw input events to match SDL style

Also added raw keyboard events, and implemented raw input events on iOS, OpenBSD console, Linux console, and X11
This commit is contained in:
Sam Lantinga 2024-12-19 16:18:05 -08:00
parent 1025087c2e
commit c44fa5bb07
25 changed files with 515 additions and 312 deletions

View file

@ -103,10 +103,10 @@ static void loop(void)
}
}
} break;
case SDL_EVENT_MOUSE_RAW_MOTION:
case SDL_EVENT_RAW_MOUSE_MOTION:
{
rect.x += event.maxis.dx / event.maxis.ux;
rect.y += event.maxis.dy / event.maxis.uy;
rect.x += event.raw_motion.dx * event.raw_motion.scale_x;
rect.y += event.raw_motion.dy * event.raw_motion.scale_y;
} break;
default:
break;
@ -212,9 +212,7 @@ int main(int argc, char *argv[])
}
}
if (raw) {
SDL_SetEventEnabled(SDL_EVENT_MOUSE_RAW_MOTION, true);
}
SDL_SetEventEnabled(SDL_EVENT_RAW_MOUSE_MOTION, raw);
rect.x = DEFAULT_WINDOW_WIDTH / 2;
rect.y = DEFAULT_WINDOW_HEIGHT / 2;