Page 1 of 1

how to know mouse/touch hit on the noesis gui?

Posted: 29 Dec 2018, 16:48
by zzh123456789
I use easytouch and noesis both. when press on the gui, I want to ignore easytouch handle. but I dont know how to test if current mouse/touch hit on the noesis gui?

Re: how to know mouse/touch hit on the noesis gui?

Posted: 31 Dec 2018, 11:30
by sfernandez
You can use VisualTreeHelper.HitTest static method to determine if mouse/touch position is over any UI element.
HitTestResult hit = VisualTreeHelper.HitTest(VisualTreeHelper.GetRoot(anyUIElement), mousePos);
if (hit.VisualHit != null)
{
  // mouse is over a UI element
}