CoreInputView CoreInputView CoreInputView CoreInputView CoreInputView Class

Definition

Enables an app to receive notifications when a docked, undocked, moveable, or transitory input pane (and associated UI) 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 : sealed class CoreInputView
struct winrt::Windows::UI::ViewManagement::Core::CoreInputView
public sealed class CoreInputView
Public NotInheritable Class CoreInputView
// This class does not provide a public constructor.
Attributes

Windows 10 requirements

Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Remarks

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 it's 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

Methods

GetCoreInputViewOcclusions() GetCoreInputViewOcclusions() GetCoreInputViewOcclusions() GetCoreInputViewOcclusions() GetCoreInputViewOcclusions()

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

GetForCurrentView() GetForCurrentView() GetForCurrentView() GetForCurrentView() GetForCurrentView()

Retrieves the CoreInputView object associated with the current window.

GetForUIContext(UIContext) GetForUIContext(UIContext) GetForUIContext(UIContext) GetForUIContext(UIContext) GetForUIContext(UIContext)

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

TryHide() TryHide() TryHide() TryHide() TryHide()

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

TryHidePrimaryView() TryHidePrimaryView() TryHidePrimaryView() TryHidePrimaryView() TryHidePrimaryView()

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

TryShow() TryShow() TryShow() TryShow() TryShow()

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

TryShow(CoreInputViewKind) TryShow(CoreInputViewKind) TryShow(CoreInputViewKind) TryShow(CoreInputViewKind) TryShow(CoreInputViewKind)

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

TryShowPrimaryView() TryShowPrimaryView() TryShowPrimaryView() TryShowPrimaryView() 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) TryTransferXYFocusToPrimaryView(Rect, CoreInputViewXYFocusTransferDirection) TryTransferXYFocusToPrimaryView(Rect, CoreInputViewXYFocusTransferDirection) TryTransferXYFocusToPrimaryView(Rect, CoreInputViewXYFocusTransferDirection) TryTransferXYFocusToPrimaryView(Rect, CoreInputViewXYFocusTransferDirection)

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

Events

OcclusionsChanged OcclusionsChanged OcclusionsChanged OcclusionsChanged OcclusionsChanged

Occurs when one or more CoreInputViewOcclusion objects change their position or occluding area.

XYFocusTransferredToPrimaryView XYFocusTransferredToPrimaryView XYFocusTransferredToPrimaryView XYFocusTransferredToPrimaryView XYFocusTransferredToPrimaryView

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

XYFocusTransferringFromPrimaryView XYFocusTransferringFromPrimaryView XYFocusTransferringFromPrimaryView XYFocusTransferringFromPrimaryView XYFocusTransferringFromPrimaryView

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

See also

  • T:Windows.UI.ViewManagement.Core.CoreInputViewOcclusion