本文整理汇总了C#中Windows.UI.Core.PointerEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# PointerEventArgs类的具体用法?C# PointerEventArgs怎么用?C# PointerEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PointerEventArgs类属于Windows.UI.Core命名空间,在下文中一共展示了PointerEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: StrokeInput_StrokeStarted
private void StrokeInput_StrokeStarted(InkStrokeInput sender, PointerEventArgs args)
{
ClearSelection();
inkCanvas.InkPresenter.UnprocessedInput.PointerPressed -= UnprocessedInput_PointerPressed;
inkCanvas.InkPresenter.UnprocessedInput.PointerMoved -= UnprocessedInput_PointerMoved;
inkCanvas.InkPresenter.UnprocessedInput.PointerReleased -= UnprocessedInput_PointerReleased;
}
开发者ID:polarapfel,项目名称:Windows-universal-samples,代码行数:7,代码来源:Scenario2.xaml.cs
示例2: OnPointerReleased
private void OnPointerReleased(DrawingSurfaceManipulationHost sender, PointerEventArgs args)
{
if (this.PointerReleased != null)
{
this.PointerReleased(sender, args);
}
}
开发者ID:r2d2rigo,项目名称:SharpDX.SimpleInitializer,代码行数:7,代码来源:SharpDXContext.cs
示例3: pointerMoved
private void pointerMoved(CoreWindow sender, PointerEventArgs e)
{
theEvent.Type = ApplicationEventTypes.MouseMove;
var loc = e.CurrentPoint.RawPosition;
theEvent.CursorPosition = new Point2((int)loc.X, (int)loc.Y);
handleEvent(theEvent);
}
开发者ID:reignstudios,项目名称:ReignSDK,代码行数:7,代码来源:CoreMetroWindow.cs
示例4: OnPointerMoved
void OnPointerMoved(CoreWindow sender, PointerEventArgs args)
{
try
{
gestureRecognizer.ProcessMoveEvents(args.GetIntermediatePoints());
}
catch (System.Exception e)
{
System.Diagnostics.Debug.WriteLine("Lets do the time warp again.");
}
}
开发者ID:Nantangitan,项目名称:GI-PJ2,代码行数:11,代码来源:GameInput.cs
示例5: OnPointerReleased
void OnPointerReleased(CoreWindow sender, PointerEventArgs args)
{
try
{
gestureRecognizer.ProcessUpEvent(args.CurrentPoint);
}
catch (System.Exception e)
{
System.Diagnostics.Debug.WriteLine("Let's do yet another time warp.");
}
}
开发者ID:Nantangitan,项目名称:GI-PJ2,代码行数:11,代码来源:GameInput.cs
示例6: PointerMoved
void PointerMoved(CoreWindow sender, PointerEventArgs args)
{
if (args.CurrentPoint.PointerDevice.PointerDeviceType == PointerDeviceType.Mouse)
{
var tmp = args.CurrentPoint.RawPosition;
var dx = tmp.X - buffer.X;
var dy = tmp.Y - buffer.Y;
Distance += Math.Sqrt(dx * dx + dy * dy);
buffer = tmp;
}
}
开发者ID:modulexcite,项目名称:CodeSharing,代码行数:11,代码来源:MouseTracker.Metro.cs
示例7: Page_PointerPressed
//Used to check if the pointer is within the bounds of the edit control.
//If it is, focus should go to the edit control. If it is outside the bounds
//Focus should not be in the edit control.
private void Page_PointerPressed(CoreWindow sender, PointerEventArgs args)
{
Rect _boundingbox = EditControl.GetLayout();
if (_boundingbox.Contains(args.CurrentPoint.Position))
{
_textEditContext.InternalSetFocus();
EditControl.Focus(FocusState.Programmatic);
}
else
{
_textEditContext.InternalRemoveFocus();
}
}
开发者ID:huoxudong125,项目名称:Windows-universal-samples,代码行数:16,代码来源:Scenario1_Input.xaml.cs
示例8: UpdateIntermediatePoints
void UpdateIntermediatePoints(PointerEventArgs args)
{
foreach (var point in args.GetIntermediatePoints())
{
if (point.IsInContact)
{
currentPointsInContact[point.PointerId] = point.Position;
}
else
{
currentPointsInContact.Remove(point.PointerId);
}
}
}
开发者ID:fengweijp,项目名称:Win2D,代码行数:14,代码来源:Renderer.cs
示例9: CoreWindow_PointerPressed
/// <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) RaisePointerGoBackGestured();
if (forwardPressed) RaisePointerGoForwardGestured();
}
}
开发者ID:Rasetech,项目名称:Template10,代码行数:26,代码来源:KeyboardHelper.cs
示例10: OnPointerPressed
//------------------------------------------------------------------------------
//
// VisualProperties.OnPointerPressed
//
// This method is called when the user touches the screen, taps it with a stylus
// or clicks the mouse.
//
//------------------------------------------------------------------------------
void OnPointerPressed(CoreWindow window, PointerEventArgs args)
{
Point position = args.CurrentPoint.Position;
//
// Walk our list of visuals to determine who, if anybody, was selected
//
foreach (var child in _root.Children)
{
//
// Did we hit this child?
//
Vector3 offset = child.Offset;
Vector2 size = child.Size;
if ((position.X >= offset.X) &&
(position.X < offset.X + size.X) &&
(position.Y >= offset.Y) &&
(position.Y < offset.Y + size.Y))
{
//
// This child was hit. Since the children are stored back to front,
// the last one hit is the front-most one so it wins
//
_currentVisual = child as ContainerVisual;
_offsetBias = new Vector2((float)(offset.X - position.X),
(float)(offset.Y - position.Y));
}
}
//
// If a visual was hit, bring it to the front of the Z order
//
if (_currentVisual != null)
{
ContainerVisual parent = _currentVisual.Parent as ContainerVisual;
parent.Children.Remove(_currentVisual);
parent.Children.InsertAtTop(_currentVisual);
}
}
开发者ID:RudyChen,项目名称:composition,代码行数:49,代码来源:VisualProperties.cs
示例11: pointerPressed
private void pointerPressed(CoreWindow sender, PointerEventArgs e)
{
if (e.CurrentPoint.Properties.IsLeftButtonPressed)
{
theEvent.Type = ApplicationEventTypes.LeftMouseDown;
leftPointerOn = true;
}
else if (e.CurrentPoint.Properties.IsMiddleButtonPressed)
{
theEvent.Type = ApplicationEventTypes.MiddleMouseDown;
middlePointerOn = true;
}
else if (e.CurrentPoint.Properties.IsRightButtonPressed)
{
theEvent.Type = ApplicationEventTypes.RightMouseDown;
rightPointerOn = true;
}
var loc = e.CurrentPoint.RawPosition;
theEvent.CursorPosition = new Point2((int)loc.X, (int)loc.Y);
handleEvent(theEvent);
}
开发者ID:reignstudios,项目名称:ReignSDK,代码行数:22,代码来源:CoreMetroWindow.cs
示例12: CoreWindow_PointerPressed
/// <summary>
/// Se invoca en cada clic del mouse, punteo en la pantalla táctil o una interacción equivalente cuando esta
/// página está activa y ocupa toda la ventana. Se usa para detectar los clics de botón del mouse
/// siguiente y anterior del estilo del explorador para navegar entre páginas.
/// </summary>
/// <param name="sender">Instancia que desencadena el evento.</param>
/// <param name="e">Datos de evento que describen las condiciones que dan lugar al evento.</param>
private void CoreWindow_PointerPressed(CoreWindow sender,
PointerEventArgs e)
{
var properties = e.CurrentPoint.Properties;
// Omitir la presión simultánea de botones con los botones Izquierda, Derecha y Medio
if (properties.IsLeftButtonPressed || properties.IsRightButtonPressed ||
properties.IsMiddleButtonPressed) return;
// Si se presiona Repág o Avpág (pero no ambos), navegar adecuadamente
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);
}
}
开发者ID:CristianJaramillo,项目名称:FocusTest,代码行数:26,代码来源:NavigationHelper.cs
示例13: OnCoreWindowPointerReleased
private void OnCoreWindowPointerReleased(CoreWindow sender, PointerEventArgs args)
{
if (args.CurrentPoint.PointerDevice.PointerDeviceType == PointerDeviceType.Mouse &&
!args.CurrentPoint.Properties.IsLeftButtonPressed &&
!args.CurrentPoint.Properties.IsMiddleButtonPressed &&
_rightMouseButtonPressed)
{
OnSwitchGesture();
args.Handled = true;
}
_rightMouseButtonPressed = false;
}
开发者ID:prabaprakash,项目名称:Visual-Studio-2013,代码行数:13,代码来源:CustomAppBar.cs
示例14: OnCoreWindowPointerPressed
private void OnCoreWindowPointerPressed(CoreWindow sender, PointerEventArgs args)
{
if (this.IsLightDismissEnabled &&
this.CanDismiss &&
this.IsOpen &&
Window.Current != null &&
Window.Current.Content != null)
{
var windowToAppBarTransform = Window.Current.Content.TransformToVisual(this);
var appBarPosition = windowToAppBarTransform.TransformPoint(args.CurrentPoint.Position);
var appBarBounds = this.GetBoundingRect(this);
if (!appBarBounds.Contains(appBarPosition))
{
this.IsOpen = false;
return;
}
}
if (args.CurrentPoint.PointerDevice.PointerDeviceType == PointerDeviceType.Mouse)
{
_rightMouseButtonPressed =
args.CurrentPoint.Properties.IsRightButtonPressed &&
!args.CurrentPoint.Properties.IsLeftButtonPressed &&
!args.CurrentPoint.Properties.IsMiddleButtonPressed;
if (_rightMouseButtonPressed)
{
args.Handled = true;
}
}
}
开发者ID:prabaprakash,项目名称:Visual-Studio-2013,代码行数:32,代码来源:CustomAppBar.cs
示例15: OnPointerPressed
// Call the gesture recognizer when a pointer event occurs
void OnPointerPressed(CoreWindow sender, PointerEventArgs args)
{
gestureRecognizer.ProcessDownEvent(args.CurrentPoint);
}
开发者ID:georgecai904,项目名称:mazeball,代码行数:5,代码来源:GameInput.cs
示例16: OnPointerMoved
//------------------------------------------------------------------------------
//
// VisualProperties.OnPointerMoved
//
// This method is called when the user moves their finger, stylus or mouse with
// a button pressed over the screen.
//
//------------------------------------------------------------------------------
void OnPointerMoved(CoreWindow window, PointerEventArgs args)
{
//
// If a visual is selected, drag it with the pointer position and
// make it opaque while we drag it
//
if (_currentVisual != null)
{
//
// Set up the properties of the visual the first time it is
// dragged. This will last for the duration of the drag
//
if (!_dragging)
{
_currentVisual.Opacity = 1.0f;
//
// Transform the first child of the current visual so that
// the image is rotated
//
foreach (var child in _currentVisual.Children)
{
child.RotationAngleInDegrees = 45.0f;
child.CenterPoint = new Vector3(_currentVisual.Size.X / 2, _currentVisual.Size.Y / 2, 0);
break;
}
//
// Clip the visual to its original layout rect by using an inset
// clip with a one-pixel margin all around
//
var clip = _compositor.CreateInsetClip();
clip.LeftInset = 1.0f;
clip.RightInset = 1.0f;
clip.TopInset = 1.0f;
clip.BottomInset = 1.0f;
_currentVisual.Clip = clip;
_dragging = true;
}
Point position = args.CurrentPoint.Position;
_currentVisual.Offset = new Vector3((float)(position.X + _offsetBias.X),
(float)(position.Y + _offsetBias.Y),
0.0f);
}
}
开发者ID:RudyChen,项目名称:composition,代码行数:56,代码来源:VisualProperties.cs
示例17: coreWindow_PointerMoved
private void coreWindow_PointerMoved(CoreWindow sender, PointerEventArgs args)
{
PincodeManager.StartIdleTimer();
}
开发者ID:maliroteh,项目名称:SalesforceMobileSDK-Windows,代码行数:4,代码来源:SalesforceApplication.cs
示例18: Input_PointerMoved
private void Input_PointerMoved(object sender, PointerEventArgs args)
{
gestureRecognizer.ProcessMoveEvents(args.GetIntermediatePoints());
args.Handled = true;
}
开发者ID:jiatingxiu,项目名称:Win2D,代码行数:5,代码来源:CustomFonts.xaml.cs
示例19: CoreWindow_PointerPressed
/// <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="args">Event data describing the conditions that led to the event.</param>
private void CoreWindow_PointerPressed(CoreWindow sender, PointerEventArgs args)
{
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 foward are pressed (but not both) navigate appropriately
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());
}
}
}
开发者ID:valentingovo,项目名称:SubSonic8,代码行数:34,代码来源:AppPage.cs
示例20: OnPointerReleased
void OnPointerReleased(CoreWindow sender, PointerEventArgs args)
{
gestureRecognizer.ProcessUpEvent(args.CurrentPoint);
}
开发者ID:georgecai904,项目名称:mazeball,代码行数:4,代码来源:GameInput.cs
注:本文中的Windows.UI.Core.PointerEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论