wpf - Hand over button event in Kinect SDK 1.7 -
i creating wpf application using kinect sdk 1.7 , need count how many times user place hand on button (not push, place over). found event responsible pushing button in xaml
<k:kinecttilebutton label="click" click="pushbuttonevent"></k:kinecttilebutton>
i can't find event responsible placing hand on button (if event exists). maybe you've got idea event that? or how resolve problem in way?
the kinecttilebutton
supports follow events hand cursor, can subscribed , acted upon desire:
public static readonly routedevent handpointermoveevent = eventmanager.registerroutedevent( "handpointermove", routingstrategy.bubble, typeof(eventhandler<handpointereventargs>), typeof(kinectregion)); public static readonly routedevent handpointerenterevent = eventmanager.registerroutedevent( "handpointerenter", routingstrategy.direct, typeof(eventhandler<handpointereventargs>), typeof(kinectregion)); public static readonly routedevent handpointerleaveevent = eventmanager.registerroutedevent( "handpointerleave", routingstrategy.direct, typeof(eventhandler<handpointereventargs>), typeof(kinectregion)); public static readonly routedevent handpointerpressevent = eventmanager.registerroutedevent( "handpointerpress", routingstrategy.bubble, typeof(eventhandler<handpointereventargs>), typeof(kinectregion)); public static readonly routedevent handpointerpressreleaseevent = eventmanager.registerroutedevent( "handpointerpressrelease", routingstrategy.bubble, typeof(eventhandler<handpointereventargs>), typeof(kinectregion)); public static readonly routedevent handpointergripevent = eventmanager.registerroutedevent( "handpointergrip", routingstrategy.bubble, typeof(eventhandler<handpointereventargs>), typeof(kinectregion)); public static readonly routedevent handpointergripreleaseevent = eventmanager.registerroutedevent( "handpointergriprelease", routingstrategy.bubble, typeof(eventhandler<handpointereventargs>), typeof(kinectregion)); public static readonly routedevent handpointergotcaptureevent = eventmanager.registerroutedevent( "handpointergotcapture", routingstrategy.direct, typeof(eventhandler<handpointereventargs>), typeof(kinectregion)); public static readonly routedevent handpointerlostcaptureevent = eventmanager.registerroutedevent( "handpointerlostcapture", routingstrategy.direct, typeof(eventhandler<handpointereventargs>), typeof(kinectregion)); public static readonly routedevent queryinteractionstatusevent = eventmanager.registerroutedevent( "queryinteractionstatus", routingstrategy.bubble, typeof(eventhandler<queryinteractionstatuseventargs>), typeof(kinectregion));
the initializekinectbuttonbase
function sets default behavior buttons:
private void initializekinectbuttonbase() { kinectregion.addhandpointerpresshandler(this, this.onhandpointerpress); kinectregion.addhandpointergotcapturehandler(this, this.onhandpointercaptured); kinectregion.addhandpointerpressreleasehandler(this, this.onhandpointerpressrelease); kinectregion.addhandpointerlostcapturehandler(this, this.onhandpointerlostcapture); kinectregion.addhandpointerenterhandler(this, this.onhandpointerenter); kinectregion.addhandpointerleavehandler(this, this.onhandpointerleave); kinectregion.setispresstarget(this, true); }
you can same in wherever defining button in ui. hook handpointerenter
, handpointerleave
handlers , can count how many times user moves hand cursor , out of region.
Comments
Post a Comment