Software Archive
Read-only legacy content
17060 Discussions

Touchless controller , cursor not moving

HexLord
Beginner
539 Views

hi everyone,

I am stuck with trying to implement the touchless controller feature.

The documentation says that once touchlesscontrollser is enables , the cursor should follow our hand. That is not happening with my in the test code I wrote. Here's the code.

The code is taken from the documentation. Also the sample has a listbox but not a freely moving cursor. Pls help.


 PXCMSenseManager sm = PXCMSenseManager.CreateInstance();
            sm.EnableTouchlessController();
            sm.Init();


            PXCMTouchlessController tc = sm.QueryTouchlessController();
            tc.SubscribeEvent(OnFiredUXEvent);
            PXCMTouchlessController.ProfileInfo pinfo;
            tc.QueryProfile(out pinfo);
            pinfo.config= PXCMTouchlessController.ProfileInfo.Configuration.Configuration_Scroll_Vertically | PXCMTouchlessController.ProfileInfo.Configuration.Configuration_Enable_Injection;
tc.SetProfile(pinfo);
            while (sm.AcquireFrame(true) >= pxcmStatus.PXCM_STATUS_NO_ERROR)
            {
                sm.ReleaseFrame();
            }
            sm.Dispose();
        }
        void OnFiredUXEvent(PXCMTouchlessController.UXEventData uxEventData) {
            textBox1.AppendText("Hey!  ");
      
            
}

 

Thanks,

Shaleen

0 Kudos
1 Reply
Yinon_O_Intel1
Employee
539 Views

Hi,

OnFiredUXEvent should be called each frame with uxEventData.type == UXEventType.UXEvent_CursorMove

and position containing the position of the cursor in rang [0,1] so you'll be able to map that according to your needs to the window, control or full screen.

Do you get those event?

when injection enabled TouchlessController  inject touch event into windows to simulate selection, scroll or zoom. The mouse does not moved automatically as this interfere with other touch injections.

 

Best Regards

Yinon

 

 

 

 

0 Kudos
Reply