Dela via


CoreInputView Class

Definition

Enables an app to control the display of a docked, undocked, moveable, or transitory input pane (and associated UI), receive notifications when the pane is moved, displayed, or hidden, and to determine which portion of the app's window is obscured by the pane.

Note

Not supported on HoloLens.

public ref class CoreInputView sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 327680)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class CoreInputView final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 327680)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class CoreInputView final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 327680)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class CoreInputView
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 327680)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class CoreInputView
Public NotInheritable Class CoreInputView
Inheritance
Object Platform::Object IInspectable CoreInputView
Attributes

Windows requirements

Device family
Windows 10 Fall Creators Update (introduced in 10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v5.0)

Remarks

Primary view refers to either of the CoreInputViewKind.Keyboard or CoreInputViewKind.Handwriting views, while CoreInputView can be any of the values from CoreInputViewKind.Handwriting.

Used by frameworks (such as XAML) or custom text controls only.

Your app can use the info exposed by this object to adjust and reflow its UI to account for any occlusion.

The CoreInputView APIs support the following types of input panes.

  • Docked Soft Input Panel (SIP) like the Touch keyboard and handwriting panel – typically, your app UI reflows.
  • Floating toolbar or SIP – typically, your app UI does not reflow.
  • Overlay panels such as inline Ink or IME candidate windows – typically, your app UI does not reflow for the edit control, but does reflow for the text/search suggestions.

The input pane appears when the user performs an action that requires them to provide information, such as entering a text field.

By default, Windows handles input pane events and repositions content so that users can see the control with focus. If you set CoreTextEditContext.InputPaneDisplayPolicy to Manual in your app, you are responsible for showing and hiding the input pane using TryShowPrimaryView and TryHidePrimaryView. Use this class to override the default behavior and customize the input pane.

Call GetForCurrentView to get a CoreInputView object.

After you register to receive input pane notifications, the system calls your event delegate whenever the pane is shown or hidden for the window that was visible when you called the GetForCurrentView method.

Note

This class is not agile, which means that you need to consider its threading model and marshaling behavior. For more info, see Threading and Marshaling (C++/CX).

Version history

Windows version SDK version Value added
1803 17134 TryTransferXYFocusToPrimaryView
1803 17134 XYFocusTransferredToPrimaryView
1803 17134 XYFocusTransferringFromPrimaryView
1809 17763 TryHide
1809 17763 TryShow
1809 17763 TryShow(CoreInputViewKind)
1903 18362 GetForUIContext
2004 19041 PrimaryViewHiding
2004 19041 PrimaryViewShowing

Methods

GetCoreInputViewOcclusions()

Retrieves a reference to each input pane currently occluding the app.

GetForCurrentView()

Retrieves the CoreInputView object associated with the current window.

GetForUIContext(UIContext)

Gets a CoreInputView object associated with the view having the specified context identifier.

IsKindSupported(CoreInputViewKind)

Gets whether the type of CoreInputView specified is supported.

TryHide()

Attempts to hide (if visible) the input pane associated with the CoreInputView pane.

TryHidePrimaryView()

Attempts to hide (if visible) the input pane associated with the CoreInputView.

TryShow()

Attempts to show (if hidden) the input pane associated with the CoreInputView.

TryShow(CoreInputViewKind)

Attempts to show (if hidden) the specified type of input pane associated with the CoreInputView.

TryShowPrimaryView()

Attempts to show (if hidden) the CoreInputView pane.

This method is a "best effort" and guarantees only that the user has a way to interact with the focused control. For a docked a Soft Input Panel (SIP) like the Touch keyboard and handwriting panel, the pane is shown only if a hardware keyboard is not available.

TryTransferXYFocusToPrimaryView(Rect, CoreInputViewXYFocusTransferDirection)

Attempts to move focus from the application UI to the input pane.

Events

OcclusionsChanged

Occurs when one or more CoreInputViewOcclusion objects change their position or occluding area in response to the repositioning of the input pane associated with the CoreInputView.

PrimaryViewAnimationStarting

Animations in the application that occur in response to the showing or hiding of the CoreInputView primary view.

PrimaryViewHiding

Occurs before the input pane associated with the CoreInputView is hidden (if visible).

PrimaryViewShowing

Occurs before the input pane associated with the CoreInputView is shown (if hidden).

SupportedKindsChanged

Occurs when the collection of supported CoreInputViewKind views for the CoreInputView changes.

XYFocusTransferredToPrimaryView

Occurs when focus is moved to the input pane from the application UI.

XYFocusTransferringFromPrimaryView

Occurs before the input pane loses focus and before a UI element gets focus.

Applies to

See also