private async void CoreWindowPointerPressed(CoreWindow sender, PointerEventArgs args) { if (!_isDragUpdated) return; args.Handled = true; await Task.Delay(DefaultDragDelay); if (_valueTextBox == null) return; _valueTextBox.IsTabStop = true; }
private void OnPointerPressed( CoreWindow sender, PointerEventArgs args ) { Contract.Requires( args != null ); var properties = args.CurrentPoint.Properties; // ignore button chords with the Left, Right, and Middle buttons if ( properties.IsLeftButtonPressed || properties.IsRightButtonPressed || properties.IsMiddleButtonPressed ) return; // if Back or Forward are pressed (but not both) navigate appropriately var backPressed = properties.IsXButton1Pressed; var forwardPressed = properties.IsXButton2Pressed; var mutuallyExclusive = backPressed ^ forwardPressed; if ( !mutuallyExclusive ) return; var frame = AssociatedObject.Frame; if ( backPressed && frame.CanGoBack ) { frame.GoBack(); args.Handled = true; } else if ( forwardPressed && frame.CanGoForward ) { frame.GoForward(); args.Handled = true; } }
public virtual void OnPointerOut(PointerEventArgs e) { if (this.PointerOut != null) { this.PointerOut(this, e); } }
private void LaserPointer_PointerOut(object sender, PointerEventArgs e) { if (btn != null) { pointerOnButton = false; btn = null; } }
private void LaserPointer_PointerIn(object sender, PointerEventArgs e) { if (e.target.gameObject.GetComponent<Button>() != null && btn == null) { btn = e.target.gameObject.GetComponent<Button>(); btn.Select(); pointerOnButton = true; } }
private async void CoreWindowOnPointerReleased(CoreWindow sender, PointerEventArgs args) { if (_isDragUpdated) { args.Handled = true; await Task.Delay(100); } }
private void CoreWindow_PointerPressed(CoreWindow sender, PointerEventArgs args) { PointerPoint currentPoint = args.CurrentPoint; press = PointerPoint.GetCurrentPoint(currentPoint.PointerId); //Windows.UI.Input.PointerPoint ptrPt = e.GetCurrentPoint(currentPoint.PointerId); }
void ProcPointerMove(object sender, PointerEventArgs pointerEventArgs) { // Debug.WriteLine("ProcPointerMove"); }
void CoreWindow_PointerPressed(CoreWindow sender, PointerEventArgs args) { // See whether the pointer is inside or outside the control. Rect contentRect = GetElementRect(BorderPanel); if (contentRect.Contains(args.CurrentPoint.Position)) { // The user tapped inside the control. Give it focus. SetInternalFocus(); // Tell XAML that this element has focus, so we don't have two // focus elements. That is the extent of our integration with XAML focus. Focus(FocusState.Programmatic); // A more complete custom control would move the caret to the // pointer position. It would also provide some way to select // text via touch. We do neither in this sample. } else { // The user tapped outside the control. Remove focus. RemoveInternalFocus(); } }
void TextAreaMouseDown(object sender, PointerEventArgs e) { mouseDownPos = e.GetPosition(this); }
public void Window_PointerReleased(CoreWindow sender, PointerEventArgs args) { // Delete the drag point draggingCameraFrom = null; }
protected override void OnPointerLeave(PointerEventArgs e) { base.OnPointerLeave(e); _drawWorking = false; this.InvalidateVisual(); }
protected override void OnPointerEnter(PointerEventArgs e) { base.OnPointerEnter(e); _drawWorking = true; this.InvalidateVisual(); }
private void Input_PointerReleased(object sender, PointerEventArgs args) { _holdProgression = false; _capturedDesiredX = null; }
private void OnTouch(object sender, PointerEventArgs e) { // Only when selling if (!selling) { return; } for (int i = 0; i < e.Pointers.Count; i++) { // Tell if we touched a card if (e.Pointers[i].GetPressData().Target != null && e.Pointers[i].GetPressData().Target.tag == "Card") { // Store in var for easier handling Transform lastTouchedCard = e.Pointers[i].GetPressData().Target; int lastTouchedCardIndex = int.Parse(lastTouchedCard.name); // Check if we own this card if (Game.Instance.CurrentPlayer.propertiesOwned.Contains(lastTouchedCardIndex)) { // Get houses manager HouseManager manager = Game.Instance.board.boardCardHouses[lastTouchedCardIndex]; // Check if it has houses or hotels if (manager.currHouses > 0 && !manager.cantClickBuy) { // Take off house manager.TakeOffHouses(); // Get paid Game.Instance.CurrentPlayer.AddCurrency(manager.housePrice); // Refresh Info Game.Instance.CurrentPlayer.RefreshPlayerInfo(); } // Else we sell the property else { if (!manager.OthersHaveHouses(lastTouchedCardIndex)) { // Remove from owned cards Game.Instance.CurrentPlayer.propertiesOwned.Remove(lastTouchedCardIndex); // Give player money back Game.Instance.CurrentPlayer.AddCurrency(Game.Instance.board.cardsPrice[lastTouchedCardIndex].price); // Hide ownership Game.Instance.board.boardOwnershipRender[lastTouchedCardIndex].enabled = false; // Make it available again Game.Instance.properties.availableCards.Add(lastTouchedCardIndex); // Refresh Info Game.Instance.CurrentPlayer.RefreshPlayerInfo(); // Check if we can sell more CheckOnSellButton(); // If we sell a property might be posible not to build Game.Instance.actions.build.CheckOnBuildButton(); } else { Debug.Log("Other properties have houses, sell them first"); } } Game.Instance.actions.payment.CheckIfIStillNeedToPay(); } } } }
private void InputElement_OnPointerLeave(object?sender, PointerEventArgs e) { (sender as TextBox).IsEnabled = false; }
// Update is called once per frame public void Actualizar() { if (!isActive) { isActive = true; this.transform.GetChild(0).gameObject.SetActive(true); } float dist = 100f; controller = GetComponent <SteamVR_TrackedController>(); //Lanzamos un rayo para detectar colliders Ray raycast = new Ray(transform.position, transform.forward); bool bHit = Physics.Raycast(raycast, out hit, dist); //Si la nueva posicion donde apunta el laser no es un objeto con un collider se llaman a los métodos //de "salida" asignados al evento pointerOut if (previousContact && previousContact != hit.transform) { PointerEventArgs args = new PointerEventArgs(); if (controller != null) { args.controllerIndex = controller.controllerIndex; } args.distance = 0f; args.flags = 0; args.target = previousContact; OnPointerOut(args); previousContact = null; } //Si el láser choca contra un collider se llaman a los métodos de "entrada" asignados //al evento pointerIn if (bHit && previousContact != hit.transform) { PointerEventArgs argsIn = new PointerEventArgs(); if (controller != null) { argsIn.controllerIndex = controller.controllerIndex; } argsIn.distance = hit.distance; argsIn.flags = 0; argsIn.target = hit.transform; OnPointerIn(argsIn); previousContact = hit.transform; } if (!bHit) { previousContact = null; } //if (bHit && hit.distance < 100f) //{ // dist = hit.distance; //} if (controller != null && controller.triggerPressed) { pointer.transform.localScale = new Vector3(thickness * 5f, thickness * 5f, dist); } else { pointer.transform.localScale = new Vector3(thickness, thickness, dist); } pointer.transform.localPosition = new Vector3(0f, 0f, dist / 2f); //comprobar que pulsamos una figura para asi mostrar el menú de figura if (bHit) { if (hit.collider.gameObject.CompareTag("Figura")) { if (controller.padPressed) { if (!canvasFigura.activeInHierarchy) { canvasFigura.SetActive(true); } seleccionada = hit.collider.gameObject; PosicionCanvas(seleccionada); } } } }
private void OnCorePointerMoved(CoreWindow sender, PointerEventArgs args) { OnPointerMoved(); }
// Update is called once per frame void Update () { if (!isActive) { isActive = true; this.transform.GetChild(0).gameObject.SetActive(true); } float dist = 100f; SteamVR_TrackedController controller = GetComponent<SteamVR_TrackedController>(); Ray raycast = new Ray(transform.position, transform.forward); RaycastHit hit; bool bHit = Physics.Raycast(raycast, out hit); if(previousContact && previousContact != hit.transform) { PointerEventArgs args = new PointerEventArgs(); if (controller != null) { args.controllerIndex = controller.controllerIndex; } args.distance = 0f; args.flags = 0; args.target = previousContact; OnPointerOut(args); previousContact = null; } if(bHit && previousContact != hit.transform) { PointerEventArgs argsIn = new PointerEventArgs(); if (controller != null) { argsIn.controllerIndex = controller.controllerIndex; } argsIn.distance = hit.distance; argsIn.flags = 0; argsIn.target = hit.transform; OnPointerIn(argsIn); previousContact = hit.transform; } if(!bHit) { previousContact = null; } if (bHit && hit.distance < 100f) { dist = hit.distance; } if (controller != null && controller.triggerPressed) { pointer.transform.localScale = new Vector3(thickness * 5f, thickness * 5f, dist); } else { pointer.transform.localScale = new Vector3(thickness, thickness, dist); } pointer.transform.localPosition = new Vector3(0f, 0f, dist/2f); }
private void StrokeInput_StrokeStarted(InkStrokeInput sender, PointerEventArgs args) { EndLassoSelectionConfig(); }
private void CoreWindowOnPointerMoved(CoreWindow sender, PointerEventArgs args) { var windowToAppBarTransform = Window.Current.Content.TransformToVisual(ellipseSense); var p = windowToAppBarTransform.TransformPoint(args.CurrentPoint.Position); Touch_FrameReported(args.CurrentPoint, p); }
protected override void OnPointerLeave(PointerEventArgs e) { IsPressed = false; }
/// <summary> /// Handles the <see cref="CoreWindow.PointerPressed"/>, <see cref="CoreWindow.PointerReleased"/>, <see cref="CoreWindow.PointerWheelChanged"/> and <see cref="CoreWindow.PointerMoved"/> events /// </summary> /// <param name="sender">Sender widow. Not used</param> /// <param name="args">Pointer event arguments.</param> private void HandleWindowPointerEvent(CoreWindow sender, PointerEventArgs args) { var p = args.CurrentPoint; // if the current device is not a mouse - ignore it if (p.PointerDevice.PointerDeviceType != WinRTPointerDeviceType.Mouse) return; UpdateMouse(p); args.Handled = true; }
private Pointer GetPointer(PointerEventArgs args) => new Pointer( args.CurrentPoint.PointerId, args.CurrentPoint.PointerDevice.PointerDeviceType, isInContact: args.CurrentPoint.IsInContact, isInRange: args.CurrentPoint.Properties.IsInRange);
private async void CoreWindowOnPointerReleased(CoreWindow sender, PointerEventArgs args) { if (_isDragUpdated) { args.Handled = true; await Task.Delay(100); if (_valueTextBox != null) { _valueTextBox.IsTabStop = true; } } }
private void CoreWindowOnPointerReleased(CoreWindow sender, PointerEventArgs args)
private void CoreWindowOnPointerReleased(CoreWindow sender, PointerEventArgs args) { if (_isDragUpdated) { args.Handled = true; this.ResumeValueTextBoxTabStopAsync(); } }
private void UnprocessedInput_PointerEntered1(InkUnprocessedInput sender, PointerEventArgs args) { border1.BorderBrush = new SolidColorBrush(Colors.Gray); border2.BorderBrush = new SolidColorBrush(Colors.Blue); inkToolbar.TargetInkCanvas = inkCanvas2; }
void ProcPointerDown(object sender, PointerEventArgs e) { Debug.WriteLine("ProcPointerDown"); }
protected override void OnPointerExited(PointerEventArgs e) { base.OnPointerExited(e); ActiveStatus = ControlStatus.Enabled; }
private void CoreWindow_PointerReleased(CoreWindow sender, PointerEventArgs args) { var currentPoint = args.CurrentPoint; release = PointerPoint.GetCurrentPoint(currentPoint.PointerId); double dx = release.Position.X - press.Position.X; double dy = release.Position.Y - press.Position.Y; if (Math.Abs(dx) > Math.Abs(dy)) { if (dx > 5) direction = DIRECTION.RIGHT; else if (dx < -5) direction = DIRECTION.LEFT; else direction = DIRECTION.INVALID; } else { if (dy < -5) direction = DIRECTION.UP; else if (dy > 5) direction = DIRECTION.DOWN; else direction = DIRECTION.INVALID; } update(); }
protected override void OnPointerEnter(PointerEventArgs e) { base.OnPointerEnter(e); ActiveStatus = ControlStatus.Highlighted; }
private void OnPointerMoved(CoreWindow sender, PointerEventArgs args) { _pointerPosition = args.CurrentPoint.Position; if (!_isShiftPressed || !_isCtrlPressed) { return; } #pragma warning disable 4014 SelectElementUnderPointer(); this.IsShown = true; #pragma warning restore 4014 }
private void Window_PointerPressed(CoreWindow sender, PointerEventArgs args) { _gestureRecognizer.ProcessDownEvent(args.CurrentPoint); }
public virtual void OnPointerIn(PointerEventArgs e) { if (PointerIn != null) PointerIn(this, e); }
void ProcPointerMove(object sender, PointerEventArgs pointerEventArgs) { // Debug.WriteLine("ProcPointerMove" + _i++); Debug.WriteLine("ProcPointerMove " + pointerEventArgs.GetPosition(this)); }
private void OnPointerPressed(CoreWindow sender, PointerEventArgs args) { var properties = args.CurrentPoint.Properties; if (properties.IsLeftButtonPressed || properties.IsRightButtonPressed || properties.IsMiddleButtonPressed) return; var backPressed = properties.IsXButton1Pressed; var forwardPressed = properties.IsXButton2Pressed; if (backPressed ^ forwardPressed) { args.Handled = true; if (backPressed) GoBack(this, new RoutedEventArgs()); if (forwardPressed) GoForward(this, new RoutedEventArgs()); } }
private void StrokeInput_StrokeEnded(InkStrokeInput sender, PointerEventArgs args) { this.toolBox.Margin = new Thickness(0, 0, 0, 0); }
private void CoreWindow_PointerMoved(object sender, PointerEventArgs args) { PointerMoved(args.CurrentPoint); args.Handled = true; }
private void CoreWindow_PointerWheelChanged(object sender, PointerEventArgs args) { UpdateMouse(args.CurrentPoint); args.Handled = true; }
private void StrokeInput_StrokeStarted(InkStrokeInput sender, PointerEventArgs args) { this.toolBox.Margin = new Thickness(0, -this.toolBox.ActualHeight, 0, 0); }
public void Window_PointerPressed(CoreWindow sender, PointerEventArgs args) { // Store the current point, to be used in drag calculations draggingCameraFrom = args.CurrentPoint; }
private void CoreWindow_PointerReleased(object sender, PointerEventArgs args) { PointerReleased(args.CurrentPoint, null, null); args.Handled = true; }
private void HandlePointerEventCoreWindow(PointerEventArgs args, PointerState pointerState) { HandlePointerEvent(args.CurrentPoint, pointerState); args.Handled = true; }
/// <summary> /// Invoked on every mouse click, touch screen tap, or equivalent interaction when this /// page is active and occupies the entire window. Used to detect browser-style next and /// previous mouse button clicks to navigate between pages. /// </summary> /// <param name="sender">Instance that triggered the event.</param> /// <param name="e">Event data describing the conditions that led to the event.</param> private void CoreWindow_PointerPressed(CoreWindow sender, PointerEventArgs e) { var properties = e.CurrentPoint.Properties; // Ignore button chords with the left, right, and middle buttons if (properties.IsLeftButtonPressed || properties.IsRightButtonPressed || properties.IsMiddleButtonPressed) return; // If back or foward are pressed (but not both) navigate appropriately bool backPressed = properties.IsXButton1Pressed; bool forwardPressed = properties.IsXButton2Pressed; if (backPressed ^ forwardPressed) { e.Handled = true; if (backPressed) this.GoBackCommand.Execute(null); if (forwardPressed) this.GoForwardCommand.Execute(null); } }
void CoreWindow_PointerMoved(CoreWindow sender, PointerEventArgs args) { DelayHideControl(); }
private void OnPointerPressed(CoreWindow sender, PointerEventArgs args) { if (!_page.UsePointerButtonsToNavigate) return; var properties = args.CurrentPoint.Properties; if (properties.IsLeftButtonPressed || properties.IsRightButtonPressed || properties.IsMiddleButtonPressed) return; var backPressed = properties.IsXButton1Pressed; var forwardPressed = properties.IsXButton2Pressed; if (backPressed ^ forwardPressed) { args.Handled = true; if (backPressed) TryGoBackAsync(); if (forwardPressed) TryGoForwardAsync(); } }
void TextViewMouseHoverStopped(object sender, PointerEventArgs e) { ToolTip.SetIsOpen(this, false); }