// Bridges VR aim-ray hit-testing (xr_input.c) to the vendored engine's // mouse input (engine/src/Libraries/INPUT/Source/mouse.h) - lets the // controller's laser pointer drive the game's own UI (inventory, menus, // dialogs) exactly like a desktop mouse: absolute cursor position plus a // single left button, no relative/mouselook mode, no right button. #ifndef QUESTSHOCK_XR_MOUSE_H #define QUESTSHOCK_XR_MOUSE_H #include #ifdef __cplusplus extern "C" { #endif // Sets the engine's absolute mouse position (mouse_put_xy()) - call every // frame the aim ray is actually hitting the game quad; x/y are pixel // coordinates in the game's own logical resolution (see // xr_get_game_resolution() in xr_session.h), already clamped by the // caller. Do not call on frames the ray isn't hitting the game quad - the // cursor should hold its last position, not snap elsewhere. void xr_mouse_move(int x, int y); // Pushes a synthetic SDL_MOUSEBUTTONDOWN/UP (SDL_BUTTON_LEFT) - matches // KeyboardOverlay's nativeSendPrintableCharDown()/Up() in // questshock_native.c: a plain SDL_Event built by hand and handed to the // public SDL_PushEvent(), // no engine patch needed. pump_events() (sdl_events.c) reads whatever // mouse_put_xy() last set, not any x/y carried on the event itself - call // xr_mouse_move() first if position needs updating this frame. void xr_mouse_click(bool down); #ifdef __cplusplus } #endif #endif