@@ -22,9 +22,10 @@ public ReadOnlySpan<RenderCommand> RunFrame(
2222 Vector2 mousePos = default ,
2323 bool mouseDown = false ,
2424 Vector2 scrollDelta = default ,
25- float deltaTime = 1f / 60f )
25+ float deltaTime = 1f / 60f ,
26+ bool rightMouseDown = false )
2627 {
27- ClayUI . BeginFrame ( new Dimensions ( 800 , 600 ) , mouseDown , mousePos , scrollDelta , deltaTime ) ;
28+ ClayUI . BeginFrame ( new Dimensions ( 800 , 600 ) , mouseDown , mousePos , scrollDelta , deltaTime , rightMouseDown ) ;
2829
2930 // Root container so widgets have a parent with known size
3031 using ( ClayApi . Element ( new ElementDeclaration
@@ -52,13 +53,14 @@ public ReadOnlySpan<RenderCommand> RunTwoFrames(
5253 Action buildUi ,
5354 Vector2 mousePos = default ,
5455 bool mouseDown = false ,
55- Vector2 scrollDelta = default )
56+ Vector2 scrollDelta = default ,
57+ bool rightMouseDown = false )
5658 {
5759 // Frame 1: establish bounding boxes (no interaction)
5860 RunFrame ( buildUi , mousePos , mouseDown : false ) ;
5961
6062 // Frame 2: with actual mouse state for interaction
61- return RunFrame ( buildUi , mousePos , mouseDown , scrollDelta ) ;
63+ return RunFrame ( buildUi , mousePos , mouseDown , scrollDelta , rightMouseDown : rightMouseDown ) ;
6264 }
6365
6466 /// <summary>
@@ -78,6 +80,16 @@ public ReadOnlySpan<RenderCommand> Click(Action buildUi, Vector2 mousePos)
7880 return RunFrame ( buildUi , mousePos , mouseDown : false ) ;
7981 }
8082
83+ /// <summary>
84+ /// Simulates a secondary-button click: establish bounds, press right button, release.
85+ /// </summary>
86+ public ReadOnlySpan < RenderCommand > RightClick ( Action buildUi , Vector2 mousePos )
87+ {
88+ RunFrame ( buildUi , mousePos , mouseDown : false , rightMouseDown : false ) ;
89+ RunFrame ( buildUi , mousePos , mouseDown : false , rightMouseDown : true ) ;
90+ return RunFrame ( buildUi , mousePos , mouseDown : false , rightMouseDown : false ) ;
91+ }
92+
8193 public void Dispose ( )
8294 {
8395 ClayUI . ClearState ( ) ;
0 commit comments