simvx.core.testing.input_sim¶
InputSimulator – simulate keyboard/mouse/touch input for headless testing.
Module Contents¶
Classes¶
Simulate input events for headless testing. |
Data¶
API¶
- simvx.core.testing.input_sim.__all__¶
[‘InputSimulator’]
- class simvx.core.testing.input_sim.InputSimulator[source]¶
Simulate input events for headless testing.
Works by directly manipulating the Input singleton state, the same mechanism that platform adapters (GLFW, SDL3) use.
Usage: from simvx.core.input import Key sim = InputSimulator() sim.press_key(Key.SPACE) runner.advance_frames(1) sim.release_key(Key.SPACE)
- press_mouse(button: int = 1, position: tuple[float, float] | None = None) None[source]¶
Simulate mouse button press, optionally at a position.
- click(position: tuple[float, float], button: int = 1) None[source]¶
Click at a screen position (press + release).
- scroll(dx: float = 0.0, dy: float = -1.0) None[source]¶
Simulate scroll wheel. dy < 0 = scroll down, dy > 0 = scroll up.
- touch_down(finger_id: int = 0, position: tuple[float, float] = (0, 0), pressure: float = 1.0) None[source]¶
Simulate a touch press (finger down).
- touch_move(finger_id: int = 0, position: tuple[float, float] = (0, 0), pressure: float = 1.0) None[source]¶
Simulate a touch move (finger drag).