private void OnGazePointerEvent(GazePointer sender, GazePointerEventArgs ea) { // Figure out what part of the GUI is currently being gazed upon UIElement _temp = ea.HitTarget; // When a new GazePointerEvent occurs, revert the previously selected object to its default (ie, non-gazed upon) appearance if (_previous != null) { if (_previous.Name.Equals("TestButton") || _previous.Name.Equals("SettingsButton")) { _previous.Background = _sideDefault; } else { _previous.Background = _navDefault; } } // Pass the button that was selected to the event handler to determine the appropriate action if (_temp.ToString().Contains("Button")) { Button _button = (Button)ea.HitTarget; GazeButton_Handler(_button); } }
/// <summary> /// Returns true if the object is to be grabbed for example grabbing a pen. /// Returns false if the object is just a click and that's it /// </summary> public virtual bool OnInteract(GazePointer pointer) { if (!canInteract) return false; // Debug.Log("On Interact"); return false; }
private void OnGazePointerEvent(GazePointer sender, GazePointerEventArgs ea) { var button = ea.HitTarget as Button; if (button == null) { return; } switch (ea.State) { case GazePointerState.Fixation: button.BorderBrush = _hoverBrush; button.BorderThickness = new Thickness(5); break; case GazePointerState.Dwell: _gazePointer.InvokeTarget(button); goto case GazePointerState.Exit; case GazePointerState.Exit: button.BorderThickness = new Thickness(0); break; } }
public void OnXamlRendered(FrameworkElement control) { GazeInput.IsDeviceAvailableChanged += GazeInput_IsDeviceAvailableChanged; WarnUserToPlugInDevice(); var buttonControl = control.FindChild("TargetButton") as Button; if (buttonControl != null) { buttonControl.Click += TargetButton_Click; gazeButtonControl = GazeInput.GetGazeElement(buttonControl); if (gazeButtonControl == null) { gazeButtonControl = new GazeElement(); GazeInput.SetGazeElement(buttonControl, gazeButtonControl); } if (gazeButtonControl != null) { gazeButtonControl.DwellProgressFeedback += OnProgressFeedback; gazeButtonControl.Invoked += OnGazeInvoked; gazeButtonControl.StateChanged += GazeButtonControl_StateChanged; } } gazePointer = GazeInput.GetGazePointer(null); CoreWindow.GetForCurrentThread().KeyDown += (CoreWindow sender, KeyEventArgs args) => gazePointer.Click(); }
public MainPage() { InitializeComponent(); Loaded += MainPage_Loaded; MasterViewModel = new ViewModel(); var sharedSettings = new ValueSet(); GazeSettingsHelper.RetrieveSharedSettings(sharedSettings).Completed = new AsyncActionCompletedHandler((asyncInfo, asyncStatus) => { var gazePointer = GazeInput.GetGazePointer(this); gazePointer.LoadSettings(sharedSettings); }); ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.FullScreen; SetPageMode(PageMode.Run); _speechSynthesizer = new SpeechSynthesizer(); _mediaElement = new MediaElement(); _backgroundBrush = new SolidColorBrush(Colors.Gray); _foregroundBrush = new SolidColorBrush(Colors.Blue); _transparentBrush = new SolidColorBrush(Colors.Transparent); _dwellProgressBrush = (SolidColorBrush)GazeInput.DwellFeedbackProgressBrush; gazePointer = GazeInput.GetGazePointer(null); Window.Current.CoreWindow.KeyDown += CoreWindow_KeyDown; }
/// <summary> /// Returns true if it can be released /// objectToInteractWith is /// </summary> /// <returns></returns> public virtual bool OffInteract(GazePointer pointer, Transform objectToInteractWith) { if (!canInteract) return false; // Debug.Log("Off Interact"); return true; }
public static void Start(Form form) { var device = GazeDevice.Instance; _gazePointer = new GazePointer(device, new NonCursor(form)); _gazePointer.AddRoot(0); _gazePointer.IsCursorVisible = true; }
private void MainPage_OnLoaded(object sender, RoutedEventArgs e) { // Set up the a GazePointer object and make it visible on screen _gaze = new GazePointer(this); _gaze.CursorRadius = 6; _gaze.IsCursorVisible = true; _gaze.GazePointerEvent += OnGazePointerEvent; }
public virtual void OffHighlight(GazePointer pointer) { if (!highlightable || !canInteract) return; if (highlightManager) highlightManager.OffHighlight(); // Debug.Log("Off Highlight"); }
public override bool OnInteract(GazePointer pointer) { base.OnInteract(pointer); isDripping = false; StopCoroutine(dripAction); return(false); }
public override bool OnInteract(GazePointer pointer) { base.OnInteract(pointer); isDripping = false; StopCoroutine (dripAction); return false; }
public BlankPage1() { this.InitializeComponent(); gazePointer = GazeInput.GetGazePointer(null); gazeButtonControl = GazeInput.GetGazeElement(GazeBlock); gazeButtonControl = new GazeElement(); GazeInput.SetGazeElement(GazeBlock, gazeButtonControl); gazeButtonControl.StateChanged += GazeButtonControl_StateChanged; // Add the object to our dictionary along with a new stopwatch stopwatchesByObject.Add(gazeButtonControl, new Stopwatch());
/// <summary> /// Returns true if the object is to be grabbed for example grabbing a pen. /// Returns false if the object is just a click and that's it /// </summary> public virtual bool OnInteract(GazePointer pointer) { if (!canInteract) { return(false); } // Debug.Log("On Interact"); return(false); }
public override bool OnInteract(GazePointer pointer) { var interact = base.OnInteract(pointer); if (interact) { trigger.SetActive(false); } return(interact); }
public override bool OnInteract(GazePointer pointer) { var interact = base.OnInteract(pointer); if (interact) { trigger.SetActive(false); } return interact; }
/// <summary> /// Returns true if it can be released /// objectToInteractWith is /// </summary> /// <returns></returns> public virtual bool OffInteract(GazePointer pointer, Transform objectToInteractWith) { if (!canInteract) { return(false); } // Debug.Log("Off Interact"); return(true); }
public override bool OffInteract(GazePointer pointer, Transform objectToInteractWith) { base.OffInteract(pointer, objectToInteractWith); this.pointer = null; gazeAnchor = null; StopAllCoroutines(); StartCoroutine(MoveToNotGrabbedPosition()); return(true); }
void MainWindow_Closed(object sender, EventArgs e) { _driveInterface?.Dispose(); _windowTimerStopwatch?.Stop(); _gazeToolbarVisiblityTimer?.Stop(); _eyesOffStopTimer?.Stop(); GazePointer.DetachAll(); Application.Current.Shutdown(); }
// protected IEnumerator FadeInAudio() // { // // // // } public virtual void OnHighlight(GazePointer pointer) { if (!highlightable || !canInteract) { return; } if (highlightManager) { highlightManager.OnHighlight(); } // Debug.Log("On Highlight"); }
public override bool OnInteract(GazePointer pointer) { var interact = base.OnInteract(pointer); if (interact) { if (puzzle && holder) { holder.FreeDropPosition(dropPosition); puzzle.RemoveFromHolder(this); } } // holder = null; // We just removed from the holder return(interact); }
public MainPage() { this.InitializeComponent(); result.SelectionChanged += OnSelectionChanged; _hoverBrush = new SolidColorBrush(Colors.IndianRed); _gazePointer = new GazePointer(this); _gazePointer.Filter = new OneEuroFilter(); _gazePointer.CursorRadius = 5; _gazePointer.IsCursorVisible = true; _gazePointer.GazePointerEvent += OnGazePointerEvent; }
// This will be called by the Gaze pointer after an object is grabbed. // public override void PhysicsUpdate() // { // if (moveToAnchor || moveToLastPosition) return; // // // anchor.position = gazeAnchor.position; // } // // public override void LogicUpdate() // { // if (moveToAnchor || moveToLastPosition) return; // // anchor.position = gazeAnchor.position; // } public override bool OnInteract(GazePointer pointer) { base.OnInteract(pointer); this.pointer = pointer; this.gazeAnchor = pointer.Anchor; // myRigidbody.isKinematic = false; beforeMovePosition = transform.position; StopAllCoroutines(); StartCoroutine(MoveToAnchorPosition()); return true; }
public override bool OnInteract(GazePointer pointer) { var interact = base.OnInteract(pointer); if (interact) { if (puzzle && holder) { holder.FreeDropPosition(dropPosition); puzzle.RemoveFromHolder(this); } } // holder = null; // We just removed from the holder return interact; }
// This will be called by the Gaze pointer after an object is grabbed. // public override void PhysicsUpdate() // { // if (moveToAnchor || moveToLastPosition) return; // // // anchor.position = gazeAnchor.position; // } // // public override void LogicUpdate() // { // if (moveToAnchor || moveToLastPosition) return; // // anchor.position = gazeAnchor.position; // } public override bool OnInteract(GazePointer pointer) { base.OnInteract(pointer); this.pointer = pointer; this.gazeAnchor = pointer.Anchor; // myRigidbody.isKinematic = false; beforeMovePosition = transform.position; StopAllCoroutines(); StartCoroutine(MoveToAnchorPosition()); return(true); }
public virtual void Install(bool reset) { #if UNITY_EDITOR if (pointerPrefab == null) { pointerPrefab = ResourceExt.EditorLoadAsset <GameObject>("Assets/Juniper/Assets/Prefabs/Rigs/DiskProbe2018.2.prefab"); } if (laserPointerNormalMaterial == null) { laserPointerNormalMaterial = ResourceExt.EditorLoadAsset <Material>("Assets/Juniper/Assets/Materials/LaserPointer_White.mat"); } if (laserPointerEnabledMaterial == null) { laserPointerEnabledMaterial = ResourceExt.EditorLoadAsset <Material>("Assets/Juniper/Assets/Materials/LaserPointer_Green.mat"); } if (laserPointerDisabledMaterial == null) { laserPointerDisabledMaterial = ResourceExt.EditorLoadAsset <Material>("Assets/Juniper/Assets/Materials/LaserPointer_Red.mat"); } #endif Find.Any(out stage); stage.Install(reset); stage.IndependentHead = HasFloorPosition; Gaze = MakePointer <GazePointer>(stage.Head, "GazePointer"); Mouse = MakePointer <Mouse>(stage.Head, "Mouse"); Helper = MakePointer <NetworkPointer>(stage.Hands, "Network"); Touches = new TouchPoint[10]; for (var i = 0; i < Touches.Length; ++i) { Touches[i] = MakePointer <TouchPoint>(stage.Head, $"Touches/TouchPoint{i.ToString()}"); Touches[i].fingerID = i; } Controllers = MotionController.MakeControllers(MakeHandPointer <MotionController>); Hands = HandTracker.MakeControllers(MakeHandPointer <HandTracker>); Voice = this.FindClosest <KeywordRecognizer>(); }
// Button interactivity for Eye Gaze private void OnGazePointerEvent(GazePointer sender, GazePointerEventArgs ea) { // Figure out what part of the GUI is currently being gazed upon UIElement _temp = ea.HitTarget; var _button = _temp as Button; // Eyes Off event if (_temp == null && _controlsEnabled) { Debug.WriteLine("Eyes Off Event!"); Stop(); } // Button Selection event else if (_button != null) { switch (ea.State) { case GazePointerState.Fixation: if (_button.Equals(PauseButton) || _button.Equals(SettingsButton) || _button.Equals(ExitButton)) { return; } Button_Handler(_button); break; case GazePointerState.Dwell: switch (_button.Name) { case "PauseButton": PausePress(); break; case "SettingsButton": SettingsPress(); break; case "ExitButton": ExitPress(); break; } break; } } }
// Button interactivity for Eye Gaze private void OnGazePointerEvent(GazePointer sender, GazePointerEventArgs ea) { // Figure out what part of the GUI is currently being gazed upon UIElement _temp = ea.HitTarget; // Eyes Off event if (_temp == null) { Debug.WriteLine("Settings: Eyes Off Event!"); } // Button Selection event var _button = _temp as Button; if (_button != null) { switch (ea.State) { case GazePointerState.Fixation: if (_button.Equals(ExitButton) || _button.Equals(SaveButton) || _button.Equals(CloseButton)) { return; } Button_Handler(_button); break; case GazePointerState.Dwell: switch (_button.Name) { case "ExitButton": StateChange(ControlStates.Goodbye, ExitPress, _button); break; case "CloseButton": StateChange(ControlStates.Goodbye, ClosePress, _button); break; case "SaveButton": StateChange(ControlStates.Default, SavePress, _button); break; } break; } } }
public override bool OnInteract(GazePointer pointer) { base.OnInteract(pointer); this.pointer = pointer; this.gazeAnchor = pointer.Anchor; placement = null; beforeMovePosition = transform.position; transform.parent = initParent; if (placed) { if (startAudioSource && customLoopStartAudio) { // StopCoroutine(CustomLoopAudio()); // Debug.Log("Starting Custom Loop Audio"); if (!doCustomLoopAudio) { StartCoroutine(CustomLoopAudio()); } } else if (startAudioSource && !startAudioSource.isPlaying) { startAudioSource.Play(); } placed = false; } StopCoroutine(MoveToAnchorPosition()); StopCoroutine(MoveToNotGrabbedPosition()); StartCoroutine(MoveToAnchorPosition()); // // if (doCustomLoopAudio) // { // StartCoroutine(CustomLoopAudio()); // } return(true); }
// Use this for initialization void Start() { m_FocusObjectText = GameObject.Find("FocusObjectText3D").GetComponent <TextMesh> (); //m_DebugText = GameObject.Find ("DebugText3D").GetComponent<TextMesh> (); //m_MoveModeText = GameObject.Find ("MoveModeText3D").GetComponent<TextMesh> (); m_FocusGazePointer = GameObject.Find("FocusGazePointer").GetComponent <GazePointer> (); //DebugInGUI (""); m_PlayerController = gameObject.GetComponent <CharacterController> (); if (m_PlayerController == null) { Debug.LogWarning("VMEPlayerController: No CharacterController attached."); } #if UNITY_ANDROID m_CameraRig = GameObject.Find("Main Camera").GetComponent <Camera> (); #else Camera[] CameraRigs = transform.GetComponentsInChildren <Camera> (); if (CameraRigs.Length == 0) { Debug.LogWarning("VMEPlayerController: No Camera attached."); } else if (CameraRigs.Length > 1) { Debug.LogWarning("VMEPlayerController: More then 1 Camera attached."); m_CameraRig = CameraRigs [0]; //still take the first } else { m_CameraRig = CameraRigs [0]; } if (!m_CameraRig.isActiveAndEnabled) { Debug.LogWarning("VMEPlayerController: No Camera attached."); } #endif Debug.Log("CameraRig set to " + m_CameraRig.name); CenterRayTracker.Init(); CenterRayTracker.SetCameraController(ref m_CameraRig); }
public override bool OffInteract(GazePointer pointer, Transform objectToInteractWith) { if (objectToInteractWith && objectToInteractWith != transform) { objectBelow = objectToInteractWith.GetComponent<GrabbableSizedObject>(); if (objectBelow) { dropPosition = objectBelow.transform.position; } } else { Debug.Log("objectBelow is null"); objectBelow = null; } return base.OffInteract(pointer, objectToInteractWith); }
public override bool OffInteract(GazePointer pointer, Transform objectToInteractWith) { if (objectToInteractWith && objectToInteractWith != transform) { objectBelow = objectToInteractWith.GetComponent <GrabbableSizedObject>(); if (objectBelow) { dropPosition = objectBelow.transform.position; } } else { Debug.Log("objectBelow is null"); objectBelow = null; } return(base.OffInteract(pointer, objectToInteractWith)); }
public override bool OnInteract(GazePointer pointer) { base.OnInteract(pointer); this.pointer = pointer; this.gazeAnchor = pointer.Anchor; placement = null; beforeMovePosition = transform.position; transform.parent = initParent; if (placed) { if (startAudioSource && customLoopStartAudio) { // StopCoroutine(CustomLoopAudio()); // Debug.Log("Starting Custom Loop Audio"); if(!doCustomLoopAudio) StartCoroutine(CustomLoopAudio()); } else if (startAudioSource && !startAudioSource.isPlaying) { startAudioSource.Play(); } placed = false; } StopCoroutine(MoveToAnchorPosition()); StopCoroutine(MoveToNotGrabbedPosition()); StartCoroutine(MoveToAnchorPosition()); // // if (doCustomLoopAudio) // { // StartCoroutine(CustomLoopAudio()); // } return true; }
public override bool OffInteract(GazePointer pointer, Transform objectToInteractWith) { if (objectToInteractWith) { holder = objectToInteractWith.GetComponent <ScribblerHolder>(); if (holder) { holder.puzzle.PutInHolder(this, holder); dropPosition = holder.GetFreeDropPosition(); } } else { Debug.Log("objectToInteractWith is null"); holder = null; } return(base.OffInteract(pointer, objectToInteractWith)); }
public override bool OffInteract(GazePointer pointer, Transform objectToInteractWith) { if (objectToInteractWith) { holder = objectToInteractWith.GetComponent<ScribblerHolder>(); if (holder) { holder.puzzle.PutInHolder(this, holder); dropPosition = holder.GetFreeDropPosition(); } } else { Debug.Log("objectToInteractWith is null"); holder = null; } return base.OffInteract(pointer, objectToInteractWith); }
public override bool OffInteract(GazePointer pointer, Transform objectToInteractWith) { base.OffInteract(pointer, objectToInteractWith); this.pointer = null; gazeAnchor = null; if (objectToInteractWith != null) { placement = objectToInteractWith.GetComponent <GrabbedInteractablePlacement>(); if (placement != null) { } } // StopAllCoroutines(); StopCoroutine(MoveToAnchorPosition()); StopCoroutine(MoveToNotGrabbedPosition()); StartCoroutine(MoveToNotGrabbedPosition()); return(true); }
private void MainWindow_Loaded(object sender, RoutedEventArgs e) { _pointer = GazePointer.Attach(this, null, GetGazeClickParameters, AppSettings.Instance.Mouse); }
static void CalibrateAction(object o) { GazePointer.LaunchRecalibration(); }
private void SettingsWindow_Loaded(object sender, RoutedEventArgs e) { GazePointer.Attach(sender as Window, null, null, AppSettings.Instance.Mouse, true); }
private void MainWindow_OnClosing(object sender, CancelEventArgs cancelEventArgs) { GazePointer.DetachAll(); }
public override bool OffInteract(GazePointer pointer, Transform objectToInteractWith) { base.OffInteract(pointer, objectToInteractWith); this.pointer = null; gazeAnchor = null; StopAllCoroutines(); StartCoroutine(MoveToNotGrabbedPosition()); return true; }
public override bool OnInteract(GazePointer pointer) { turnedOn = !turnedOn; Toggle(); return false; }
public override bool OffInteract(GazePointer pointer, Transform objectToInteractWith) { base.OffInteract(pointer, objectToInteractWith); this.pointer = null; gazeAnchor = null; if (objectToInteractWith != null) { placement = objectToInteractWith.GetComponent<GrabbedInteractablePlacement>(); if (placement != null) { } } // StopAllCoroutines(); StopCoroutine(MoveToAnchorPosition()); StopCoroutine(MoveToNotGrabbedPosition()); StartCoroutine(MoveToNotGrabbedPosition()); return true; }
private void SettingsWindow_Loaded(object sender, RoutedEventArgs e) { GazePointer.Attach(sender as Window, null, null, null, true); StopAllCameras(); }
public override bool OnInteract(GazePointer pointer) { return interactable.OnInteract(pointer); }
public override void OnHighlight(GazePointer pointer) { interactable.OnHighlight(pointer); }
public override bool OffInteract(GazePointer pointer, Transform objectToInteractWith) { return interactable.OffInteract(pointer, objectToInteractWith); }