public override Capture ForceEndCapture(InputState input, CaptureData data) { if (pCapturing != null) { pCapturing.EndCapture(InputEvent.Gamepad(input)); pCapturing = null; ActiveInput = WhichInput.None; } return(Capture.End); }
public override CaptureRequest WantsCapture(InputState input) { UIRayHit uiHit; if (input.bLeftTriggerPressed || input.bAButtonPressed) { ActiveInput = (input.bLeftTriggerPressed) ? WhichInput.LeftTrigger : WhichInput.AButton; if (scene.FindUIHit(input.vGamepadWorldRay, out uiHit)) { bool bCanCapture = uiHit.hitUI.WantsCapture(InputEvent.Gamepad(input, new AnyRayHit(uiHit))); if (bCanCapture) { return(CaptureRequest.Begin(this)); } } } return(CaptureRequest.Ignore); }
public override Capture BeginCapture(InputState input, CaptureSide eWhich) { pCapturing = null; UIRayHit uiHit; if (input.bLeftTriggerPressed || input.bAButtonPressed) { ActiveInput = (input.bLeftTriggerPressed) ? WhichInput.LeftTrigger : WhichInput.AButton; if (scene.FindUIHit(input.vGamepadWorldRay, out uiHit)) { bool bCanCapture = uiHit.hitUI.BeginCapture(InputEvent.Gamepad(input, new AnyRayHit(uiHit))); if (bCanCapture) { pCapturing = uiHit.hitUI; return(Capture.Begin(this)); } } } return(Capture.Ignore); }
public override Capture UpdateCapture(InputState input, CaptureData data) { if ((ActiveInput == WhichInput.LeftTrigger && input.bLeftTriggerDown) || (ActiveInput == WhichInput.AButton && input.bAButtonDown)) { pCapturing.UpdateCapture(InputEvent.Gamepad(input)); return(Capture.Continue); } else if ((ActiveInput == WhichInput.LeftTrigger && input.bLeftTriggerReleased) || (ActiveInput == WhichInput.AButton && input.bAButtonReleased)) { pCapturing.EndCapture(InputEvent.Gamepad(input)); pCapturing = null; ActiveInput = WhichInput.None; return(Capture.End); } else { // [RMS] can end up here sometimes in Gamepad if we do camera controls // while we are capturing... ActiveInput = WhichInput.None; return(Capture.End); } }