protected virtual void OnPreviewStylusButtonUp(StylusButtonEventArgs e);
Esempio n. 2
0
        private static void OnPreviewStylusButtonUpThunk(object sender, StylusButtonEventArgs e)
        {
            Invariant.Assert(!e.Handled, "Unexpected: Event has already been handled.");

            UIElement uie = sender as UIElement;

            if (uie != null)
            {
                uie.OnPreviewStylusButtonUp(e);
            }
            else
            {
                ContentElement ce = sender as ContentElement;

                if (ce != null)
                {
                    ce.OnPreviewStylusButtonUp(e);
                }
                else
                {
                    ((UIElement3D)sender).OnPreviewStylusButtonUp(e);
                }
            }
        }
Esempio n. 3
0
		protected virtual void OnStylusButtonUp(StylusButtonEventArgs e)
		{
			throw new NotImplementedException ();
		}
 protected virtual void OnStylusButtonDown(StylusButtonEventArgs e);
Esempio n. 5
0
 void inqCanvas_PreviewStylusUp(object sender, StylusButtonEventArgs e)
 {
     if (_moving)
     {
         _moving = false;
         using (_mrec.BatchEditNoRecog(true))
         {
             Selected.Contents.MoveTo(e.GetPosition(inqCanvas));
         }
         Selected.Contents.EndMove();
         if (_movingLock != null)
         {
             _movingLock.Dispose(); // this will call Parse itself
             _movingLock = null;
         }
         else Selected.Contents.Reparse(_mrec); // make sure math is updated and do a full rerecog just in case; we have only been doing non-re-recognition parses for speed
         Deselect();
         Mouse.Capture(null);
         e.Handled = true;
         inqCanvas.InkEnabled = true;
     }
 }
Esempio n. 6
0
		protected virtual void OnPreviewStylusButtonDown(StylusButtonEventArgs e)
		{
			throw new NotImplementedException ();
		}
Esempio n. 7
0
        /// @internal
        /// <inheritdoc />
        protected override void OnPreviewStylusButtonUp( StylusButtonEventArgs e )
        {
            if ( !IsLive )
                return;

            this.Focus();
            awe_webview_inject_mouse_up( Instance, MouseButton.Left );
            base.OnPreviewStylusButtonUp( e );
        }
 /// <summary>
 ///     Virtual method reporting the stylus button is down
 /// </summary>
 protected internal virtual void OnStylusButtonDown(StylusButtonEventArgs e) {}
Esempio n. 9
0
 void invoker_StylusButtonDown(object sender, StylusButtonEventArgs e)
 {
     this.OnStylusButtonDown(e);
 }
Esempio n. 10
0
 protected override void OnStylusButtonUp(StylusButtonEventArgs e)
 {
     base.OnStylusButtonUp(e);
 }
Esempio n. 11
0
 private void cProbe_StylusButtonUp(object sender, StylusButtonEventArgs e)
 {
     DisplayEvent("StylusButtonUp", e.ToText());
 }
Esempio n. 12
0
        private void UpdateButtonStates(ProcessInputEventArgs e)
        { 
            if (!e.StagingItem.Input.Handled) 
            {
                RoutedEvent routedEvent = e.StagingItem.Input.RoutedEvent; 
                if (routedEvent != null && (routedEvent == Stylus.StylusDownEvent
                                     || routedEvent == Stylus.StylusUpEvent
                                     || routedEvent == Stylus.StylusMoveEvent
                                     || routedEvent == Stylus.StylusInAirMoveEvent)) 
                {
                    StylusEventArgs eventArgs = (StylusEventArgs)e.StagingItem.Input; 
                    RawStylusInputReport report = eventArgs.InputReport; 

                    StylusDevice stylusDevice = report.StylusDevice; 
                    System.Diagnostics.Debug.Assert(stylusDevice != null);

                    StylusPointCollection stylusPoints = stylusDevice.GetStylusPoints(null);
                    StylusPoint stylusPoint = stylusPoints[stylusPoints.Count - 1]; 

                    foreach (StylusButton button in stylusDevice.StylusButtons) 
                    { 

                        // ISSUE-2005/2/2-XIAOTU what if more than one button state in a single packet? 
                        // Split the packets or only use the last one as we did below?

                        StylusButtonState currentButtonState =
                            (StylusButtonState)stylusPoint.GetPropertyValue(new StylusPointProperty(button.Guid, true)); 

                        if (currentButtonState != button.CachedButtonState) 
                        { 
                           button.CachedButtonState = currentButtonState;
 
                           // do work to push Button event
                           StylusButtonEventArgs args = new StylusButtonEventArgs(stylusDevice, report.Timestamp, button);
                           args.InputReport = report;
                           if (currentButtonState == StylusButtonState.Down) 
                           {
                               args.RoutedEvent=Stylus.PreviewStylusButtonDownEvent; 
                           } 
                           else
                           { 
                               args.RoutedEvent=Stylus.PreviewStylusButtonUpEvent;
                           }

                           // Process this directly instead of doing a push. We want this event to get 
                           // to the user before the promoted mouse event.
                           InputManagerProcessInputEventArgs(args); 
                        } 
                    }
                } 
            }
        }
Esempio n. 13
0
        void PromotePreviewToMain(ProcessInputEventArgs e) 
        { 
            if (!e.StagingItem.Input.Handled)
            { 
                RoutedEvent eventMain = GetMainEventFromPreviewEvent(e.StagingItem.Input.RoutedEvent);
                if (eventMain != null)
                {
                    StylusEventArgs eventArgsPreview = (StylusEventArgs)e.StagingItem.Input; 
                    StylusDevice stylusDevice = eventArgsPreview.InputReport.StylusDevice;
 
                    StylusEventArgs eventArgsMain; 
                    if (eventMain == Stylus.StylusDownEvent ||
                        eventMain == Stylus.PreviewStylusDownEvent) 
                    {
                        StylusDownEventArgs downEventArgsPreview = (StylusDownEventArgs)eventArgsPreview;
                        eventArgsMain = new StylusDownEventArgs(stylusDevice, eventArgsPreview.Timestamp);
                    } 
                    else if (eventMain == Stylus.StylusButtonDownEvent ||
                        eventMain == Stylus.StylusButtonUpEvent) 
                    { 
                        StylusButtonEventArgs buttonEventArgsPreview = (StylusButtonEventArgs)eventArgsPreview;
                        eventArgsMain = new StylusButtonEventArgs(stylusDevice, eventArgsPreview.Timestamp, buttonEventArgsPreview.StylusButton); 
                    }
                    else if (eventMain != Stylus.StylusSystemGestureEvent)
                    {
                        eventArgsMain = new StylusEventArgs(stylusDevice, eventArgsPreview.Timestamp); 
                    }
                    else 
                    { 
                        StylusSystemGestureEventArgs previewSystemGesture = (StylusSystemGestureEventArgs)eventArgsPreview;
                        eventArgsMain = new StylusSystemGestureEventArgs(stylusDevice, 
                                                                         previewSystemGesture.Timestamp,
                                                                         previewSystemGesture.SystemGesture,
                                                                         previewSystemGesture.GestureX,
                                                                         previewSystemGesture.GestureY, 
                                                                         previewSystemGesture.ButtonState);
                    } 
                    eventArgsMain.InputReport = eventArgsPreview.InputReport; 
                    eventArgsMain.RoutedEvent = eventMain;
                    e.PushInput(eventArgsMain, e.StagingItem); 
                }
            }
            else
            { 
                // A TouchDevice is activated before TouchDown and deactivated after TouchUp
                // But if PreviewStylusUp event is handled by the user, it will 
                // never be promoted to TouchUp event leaving the TouchDevice in inconsistent 
                // active state. Hence deactivating touch device if it is active.
                StylusEventArgs stylusEventArgs = e.StagingItem.Input as StylusEventArgs; 
                if (stylusEventArgs != null &&
                    stylusEventArgs.RoutedEvent == Stylus.PreviewStylusUpEvent &&
                    stylusEventArgs.StylusDevice.TouchDevice.IsActive)
                { 
                    stylusEventArgs.StylusDevice.TouchDevice.OnDeactivate();
                } 
            } 
        }
Esempio n. 14
0
 /// <summary>
 ///     Virtual method reporting the stylus button is up
 /// </summary>
 protected virtual void OnStylusButtonUp(StylusButtonEventArgs e) {}
        private void HandleStylusDown(object sender, StylusButtonEventArgs e)
        {
            penPressedButtonsCount++;
            var eventType = penPressedButtonsCount > 1 ? PointerEventType.Moved : PointerEventType.Pressed;

            var updateKind = e.Inverted ? PointerUpdateKind.RightButtonPressed : PointerUpdateKind.LeftButtonPressed;

            AddPenPointerEvent(eventType, updateKind, true, e);
        }
Esempio n. 16
0
 /// <summary>
 ///     Virtual method reporting the stylus button is down
 /// </summary>
 protected virtual void OnPreviewStylusButtonDown(StylusButtonEventArgs e) {}
        private void HandleStylusUp(object sender, StylusButtonEventArgs e)
        {
            penPressedButtonsCount--;
            var eventType = penPressedButtonsCount > 0 ? PointerEventType.Moved : PointerEventType.Released;

            var updateKind = e.Inverted ? PointerUpdateKind.RightButtonReleased : PointerUpdateKind.LeftButtonReleased;

            AddPenPointerEvent(eventType, updateKind, false, e);
        }
 /// <summary>
 ///     Virtual method reporting the stylus button is up
 /// </summary>
 protected internal virtual void OnPreviewStylusButtonUp(StylusButtonEventArgs e) {}
 private void OnStylusButtonEventArgs(object sender, StylusButtonEventArgs e)
 {
     if (!IsSampling(sender))
     {
         return;
     }
     _itw.WriteLine(".RaiseStylusButtonEvent({0})", e.RoutedEvent.OwnerType.Name + "." + e.RoutedEvent.Name + "Event");
     CodeBox.Text = _sw.ToString();
 }