コード例 #1
0
 protected virtual void OnPreviewStylusButtonUp(StylusButtonEventArgs e);
コード例 #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);
                }
            }
        }
コード例 #3
0
ファイル: ContentElement.cs プロジェクト: alesliehughes/olive
		protected virtual void OnStylusButtonUp(StylusButtonEventArgs e)
		{
			throw new NotImplementedException ();
		}
コード例 #4
0
 protected virtual void OnStylusButtonDown(StylusButtonEventArgs e);
コード例 #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;
     }
 }
コード例 #6
0
ファイル: ContentElement.cs プロジェクト: alesliehughes/olive
		protected virtual void OnPreviewStylusButtonDown(StylusButtonEventArgs e)
		{
			throw new NotImplementedException ();
		}
コード例 #7
0
ファイル: WebControl.cs プロジェクト: UIKit0/AwesomiumSharp
        /// @internal
        /// <inheritdoc />
        protected override void OnPreviewStylusButtonUp( StylusButtonEventArgs e )
        {
            if ( !IsLive )
                return;

            this.Focus();
            awe_webview_inject_mouse_up( Instance, MouseButton.Left );
            base.OnPreviewStylusButtonUp( e );
        }
コード例 #8
0
 /// <summary>
 ///     Virtual method reporting the stylus button is down
 /// </summary>
 protected internal virtual void OnStylusButtonDown(StylusButtonEventArgs e) {}
コード例 #9
0
ファイル: CustomInkCanvas.cs プロジェクト: rudi-c/htn-stylus
 void invoker_StylusButtonDown(object sender, StylusButtonEventArgs e)
 {
     this.OnStylusButtonDown(e);
 }
コード例 #10
0
ファイル: CustomInkCanvas.cs プロジェクト: rudi-c/htn-stylus
 protected override void OnStylusButtonUp(StylusButtonEventArgs e)
 {
     base.OnStylusButtonUp(e);
 }
コード例 #11
0
ファイル: TouchTest.xaml.cs プロジェクト: jithuin/infogeezer
 private void cProbe_StylusButtonUp(object sender, StylusButtonEventArgs e)
 {
     DisplayEvent("StylusButtonUp", e.ToText());
 }
コード例 #12
0
ファイル: StylusLogic.cs プロジェクト: sjyanxin/WPFSource
        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); 
                        } 
                    }
                } 
            }
        }
コード例 #13
0
ファイル: StylusLogic.cs プロジェクト: sjyanxin/WPFSource
        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();
                } 
            } 
        }
コード例 #14
0
 /// <summary>
 ///     Virtual method reporting the stylus button is up
 /// </summary>
 protected virtual void OnStylusButtonUp(StylusButtonEventArgs e) {}
コード例 #15
0
        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);
        }
コード例 #16
0
 /// <summary>
 ///     Virtual method reporting the stylus button is down
 /// </summary>
 protected virtual void OnPreviewStylusButtonDown(StylusButtonEventArgs e) {}
コード例 #17
0
        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);
        }
コード例 #18
0
 /// <summary>
 ///     Virtual method reporting the stylus button is up
 /// </summary>
 protected internal virtual void OnPreviewStylusButtonUp(StylusButtonEventArgs e) {}
コード例 #19
0
 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();
 }