diff --git a/docs/input/pointer.md b/docs/input/pointer.md index df8f6b8..72c775d 100644 --- a/docs/input/pointer.md +++ b/docs/input/pointer.md @@ -1,6 +1,6 @@ # 鼠标与触控设备 -Avalonia operates on the abstraction called pointer devices. These devices including, but not limited to mouse, touch, pen etc. Each control in Avalonia provides following events which allow developer to subscribe to the pointer device movements, clicks and wheel movements: +Avalonia 可工作于我们称之为“定点设备”的基础上。这类设备包括但不限于鼠标、触摸板与数位笔等。Avalonia中的每个控件都提供了如下事件,允许开发者追踪定点设备的移动、点击与滚动: - PointerEnter - PointerLeave - PointerMoved @@ -8,7 +8,7 @@ Avalonia operates on the abstraction called pointer devices. These devices inclu - PointerReleased - PointerWheelChanged -Example how to react on pointer button pressed. +以下是一个如何响应指针按钮按下的实例。 ```csharp control.PointerPressed += (args) => @@ -27,15 +27,15 @@ control.PointerPressed += (args) => } ``` -In the example above, coordinates `x` and `y` are relatively to the window origin. If you want coordinates relative to the specific control, you may pass it to `PointerEventArgs.GetCurrentPoint` method like this: `var pointControlCoords = args.GetCurrentPoint(control);` +在上述实例中,坐标 `x` 和 `y` 是相对于窗口原点定位的。如果你希望这些坐标相对定位于某个控件, 你可以将该控件传入 `PointerEventArgs.GetCurrentPoint` 函数,如: `var pointControlCoords = args.GetCurrentPoint(control);` -# Tapped event args +# 点击事件的参数: -Each control also has special gesture events: Tapped and DoubleTapped. -Tapped is raised, when pointer was pressed on the control and then released. -While DoubleTapped is raised after pointer was pressed twice on the same place. Allowed size (distance between first and second "tap") and time (delay between them) depend on the platform and usually is bigger for the touch devices. +每个控件都有如下两个事件:单击(Tapped)和双击(DoubleTapped)。 +当指针在控件上按下并抬起时,响应为单击(Tapped)。 +当指针在同一位置上按下两次后,双击(DoubleTapped)被触发。允许的大小(size,两次“点击”间的距离)和时间(time,两次“点击”间的延迟)取决于程序工作的平台。通常来说,在触摸设备上这两个值会更大。 -### Reference +### 参考 -[Control](http://reference.avaloniaui.net/api/Avalonia.Controls/Control/) -[PointerEventArgs](http://reference.avaloniaui.net/api/Avalonia.Input/PointerEventArgs/) +[控件(Control)](http://reference.avaloniaui.net/api/Avalonia.Controls/Control/) +[指针事件参数(PointerEventArgs)](http://reference.avaloniaui.net/api/Avalonia.Input/PointerEventArgs/)