IInputElement 接口

定义

为 Windows Presentation Foundation (WPF) 元素进行的基本输入处理建立公共事件,以及事件相关属性和方法。Establishes the common events and also the event-related properties and methods for basic input processing by Windows Presentation Foundation (WPF) elements.

public interface class IInputElement
public interface IInputElement
type IInputElement = interface
Public Interface IInputElement
派生

注解

重要

尽管此接口是公共的, 但不应在应用程序或框架构建方案中实现。Although this interface is public, it is not intended to be implemented in application or framework-building scenarios. 由于将WPFWPF核心连接WPFWPF到框架的继承要求, 此接口是公共的。This interface is public because of the inheritance requirements for connecting the WPFWPF core to the WPFWPF framework. 你还可以使用此接口作为强制转换机制来强制输入事件和属性FrameworkElement来自或FrameworkContentElement, 可以在同一输入模型中处理。You can also use this interface as a casting mechanism to enforce that the input events and properties will come from either a FrameworkElement or FrameworkContentElement, which can be handled in the same input model. 有关详细信息, 请参阅WPF 体系结构基本元素概述For more information, see WPF Architecture and also see Base Elements Overview.

属性

Focusable

获取或设置一个值,该值指示是否可将焦点设置到此元素。Gets or sets a value that indicates whether focus can be set to this element.

IsEnabled

获取一个值,该值指示是否在 用户界面 (UI)user interface (UI) 中启用了此元素。Gets a value that indicates whether this element is enabled in the 用户界面 (UI)user interface (UI).

IsKeyboardFocused

获取一个值,该值指示此元素是否具有键盘焦点。Gets a value that indicates whether this element has keyboard focus.

IsKeyboardFocusWithin

获取一个值,该值指示键盘焦点是否处于元素边界内的任何位置(包括键盘焦点是否位于任何可视子元素的边界内)。Gets a value that indicates whether keyboard focus is anywhere inside the element bounds, including if keyboard focus is inside the bounds of any visual child elements.

IsMouseCaptured

获取一个值,该值指示是否将鼠标捕获到此元素。Gets a value that indicates whether the mouse is captured to this element.

IsMouseDirectlyOver

获取一个值,该值指示在最严格的命中测试意义上鼠标指针是否位于此元素上。Gets a value that indicates whether the mouse pointer is over this element in the strictest hit testing sense.

IsMouseOver

获取一个值,该值指示鼠标指针是否位于此元素(包括其边界内的可视子元素)上方。Gets a value that indicates whether the mouse pointer is located over this element (including visual children elements that are inside its bounds).

IsStylusCaptured

获取一个值,该值指示是否将触笔捕获到此元素。Gets a value that indicates whether the stylus is captured to this element.

IsStylusDirectlyOver

获取一个值,从最严格的命中测试角度指示该触笔是否位于此元素上。Gets a value that indicates whether the stylus is over this element in the strictest hit testing sense.

IsStylusOver

获取一个值,该值指示触笔是否位于此元素(或其边界内的可视子元素)上方。Gets a value that indicates whether the stylus is located over this element (or over visual child elements that are inside its bounds).

方法

AddHandler(RoutedEvent, Delegate)

将特定的路由事件的路由事件处理程序添加到元素。Adds a routed event handler for a specific routed event to an element.

CaptureMouse()

尝试将鼠标强制捕获到此元素。Attempts to force capture of the mouse to this element.

CaptureStylus()

尝试将触笔强制捕获到此元素。Attempts to force capture of the stylus to this element.

Focus()

尝试使键盘焦点位于此元素上。Attempts to focus the keyboard on this element.

RaiseEvent(RoutedEventArgs)

引发路由事件,该事件由所提供的 RoutedEvent 内的 RoutedEventArgs 属性指定。Raises the routed event that is specified by the RoutedEvent property within the provided RoutedEventArgs.

ReleaseMouseCapture()

如果此元素具有鼠标捕获,则释放该捕获。Releases the mouse capture, if this element holds the capture.

ReleaseStylusCapture()

如果此元素具有触笔捕获,则释放该捕获。Releases the stylus capture, if this element holds the capture.

RemoveHandler(RoutedEvent, Delegate)

从此元素中删除指定路由事件处理程序的所有实例。Removes all instances of the specified routed event handler from this element.

事件

GotKeyboardFocus

在此元素聚焦于键盘时发生。Occurs when the keyboard is focused on this element.

GotMouseCapture

在元素捕获鼠标时发生。Occurs when the element captures the mouse.

GotStylusCapture

在元素捕获触笔时发生。Occurs when the element captures the stylus.

KeyDown

在此元素聚焦于键盘并且按下某个键时发生。Occurs when a key is pressed while the keyboard is focused on this element.

KeyUp

在此元素聚焦于键盘并且松开某个键时发生。Occurs when a key is released while the keyboard is focused on this element.

LostKeyboardFocus

在此元素不再聚焦于键盘时发生。Occurs when the keyboard is no longer focused on this element.

LostMouseCapture

在此元素丢失鼠标捕获时发生。Occurs when this element loses mouse capture.

LostStylusCapture

在此元素丢失触笔捕获时发生。Occurs when this element loses stylus capture.

MouseEnter

在鼠标指针进入此元素的边界时发生。Occurs when the mouse pointer enters the bounds of this element.

MouseLeave

在鼠标指针离开此元素的边界时发生。Occurs when the mouse pointer leaves the bounds of this element.

MouseLeftButtonDown

在鼠标指针位于元素上并且按下鼠标左键时发生。Occurs when the left mouse button is pressed while the mouse pointer is over the element.

MouseLeftButtonUp

在鼠标指针位于元素上并且松开鼠标左键时发生。Occurs when the left mouse button is released while the mouse pointer is over the element.

MouseMove

在鼠标指针位于元素上并且鼠标指针移动时发生。Occurs when the mouse pointer moves while the mouse pointer is over the element.

MouseRightButtonDown

在鼠标指针位于元素上并且按下鼠标右键时发生。Occurs when the right mouse button is pressed while the mouse pointer is over the element.

MouseRightButtonUp

在鼠标指针位于元素上并且松开鼠标右键时发生。Occurs when the right mouse button is released while the mouse pointer is over the element.

MouseWheel

当鼠标指针位于此元素上并且鼠标滚轮移动时发生。Occurs when the mouse wheel moves while the mouse pointer is over this element.

PreviewGotKeyboardFocus

在此元素聚焦于键盘时发生。Occurs when the keyboard is focused on this element.

PreviewKeyDown

在此元素聚焦于键盘并且按下某个键时发生。Occurs when a key is pressed while the keyboard is focused on this element.

PreviewKeyUp

在此元素聚焦于键盘并且松开某个键时发生。Occurs when a key is released while the keyboard is focused on this element.

PreviewLostKeyboardFocus

在此元素不再聚焦于键盘时发生。Occurs when the keyboard is no longer focused on this element.

PreviewMouseLeftButtonDown

在鼠标指针位于元素上并且按下鼠标左键时发生。Occurs when the left mouse button is pressed while the mouse pointer is over the element.

PreviewMouseLeftButtonUp

在鼠标指针位于元素上并且松开鼠标左键时发生。Occurs when the left mouse button is released while the mouse pointer is over the element.

PreviewMouseMove

在鼠标指针位于元素上并且鼠标指针移动时发生。Occurs when the mouse pointer moves while the mouse pointer is over the element.

PreviewMouseRightButtonDown

在鼠标指针位于元素上并且按下鼠标右键时发生。Occurs when the right mouse button is pressed while the mouse pointer is over the element.

PreviewMouseRightButtonUp

在鼠标指针位于元素上并且松开鼠标右键时发生。Occurs when the right mouse button is released while the mouse pointer is over the element.

PreviewMouseWheel

当鼠标指针位于此元素上并且鼠标滚轮移动时发生。Occurs when the mouse wheel moves while the mouse pointer is over this element.

PreviewStylusButtonDown

当触笔位于此元素上并按下触笔按钮时发生。Occurs when the stylus button is pressed down while the stylus is over this element.

PreviewStylusButtonUp

当触笔位于此元素上并释放触笔按钮时发生。Occurs when the stylus button is released while the stylus is over this element.

PreviewStylusDown

在触笔位于元素上且同时触及数字化器时发生。Occurs when the stylus touches the digitizer while over this element.

PreviewStylusInAirMove

在触笔移到元素上却未触及数字化器时发生。Occurs when the stylus moves over an element, but without touching the digitizer.

PreviewStylusInRange

在触笔与数字化仪之间的距离近到足以检测到触笔时发生。Occurs when the stylus is close enough to the digitizer to be detected.

PreviewStylusMove

在触笔位于元素上并且移动触笔时发生。Occurs when the stylus moves while the stylus is over the element.

PreviewStylusOutOfRange

在触笔与数字化仪之间的距离太远以致无法检测到触笔时发生。Occurs when the stylus is too far from the digitizer to be detected.

PreviewStylusSystemGesture

当检测到若干触笔笔势之一时发生,例如 TapDragOccurs when one of several stylus gestures are detected, for example, Tap or Drag.

PreviewStylusUp

在触笔悬停于此元素上并接触数字化器时发生。Occurs when the stylus is raised off the digitizer while over this element.

PreviewTextInput

在此元素以设备无关模式获取文本时发生。Occurs when this element gets text in a device-independent manner.

StylusButtonDown

当触笔位于此元素上并按下触笔按钮时发生。Occurs when the stylus button is pressed while the stylus is over this element.

StylusButtonUp

当触笔位于此元素上并释放触笔按钮时发生。Occurs when the stylus button is released while the stylus is over this element.

StylusDown

在触笔位于元素上且同时触及数字化器时发生。Occurs when the stylus touches the digitizer while over this element.

StylusEnter

在触笔光标进入元素边界时发生。Occurs when the stylus cursor enters the bounds of the element.

StylusInAirMove

在触笔移到元素上却未触及数字化器时发生。Occurs when the stylus moves over an element, but without touching the digitizer.

StylusInRange

在触笔与数字化仪之间的距离近到足以检测到触笔时发生。Occurs when the stylus is close enough to the digitizer to be detected.

StylusLeave

在触笔光标离开元素边界时发生。Occurs when the stylus cursor leaves the bounds of the element.

StylusMove

在触笔光标移到元素上时发生。Occurs when the stylus cursor moves over the element.

StylusOutOfRange

在触笔与数字化仪之间的距离太远以致无法检测到触笔时发生。Occurs when the stylus is too far from the digitizer to be detected.

StylusSystemGesture

当检测到若干触笔笔势之一时发生,例如 TapDragOccurs when one of several stylus gestures are detected, for example, Tap or Drag.

StylusUp

在触笔悬停于此元素上并接触数字化器时发生。Occurs when the stylus is raised off the digitizer while over this element.

TextInput

在此元素以设备无关模式获取文本时发生。Occurs when this element gets text in a device-independent manner.

适用于

另请参阅