0

How to Share Mouse and Keyboard inputs with custom camera controller

Ahmed moussa 1 year ago updated 1 year ago 0

I made a custom camera controller to create an arcball camera movements, but I can't take mouse or keyboard inputs applied to the viewport
the mousedown event of my controller is bound to a border containing the viewport
the event only receives left mouse clicks 
is it possible to allow the border to receive inputs?

my camera controller will work as expected if I exposed the border ,like makeing a Margin for the viewport so that some area of the border is visible.
also hopfolly without  affecting the hit behavior ,that allows me to select  3d opjects by clicking on them .
also it's possible to to set the viewport as EventsSourceElement but will gave the same result ,although it's better to use a border .

I am using SharpDX .Net6

//xaml <Grid Grid.Column="1"> <Border Name="ViewportBor - Pastebin.com


<script src="https://pastebin.com/embed_js/GBXdzyiL?theme=dark"></script>