KeyboardLayoutProvider Class
The source of the keyboard layout of the device (https://wicg.github.io/keyboard-map/), read by navigator.keyboard.getLayoutMap() in the browsing contexts that share a BrowsingContextOptions (KeyboardMapOptions.Provider). The default implementation returns KeyboardLayoutProvider.Layout, set by the application. Override KeyboardLayoutProvider.GetLayout to read another source, and call KeyboardLayoutProvider.OnLayoutChanged when the layout changes, to fire the layoutchange event of the Keyboard objects of the documents.
public class KeyboardLayoutProviderRemarks
A provider can be shared by several browsing contexts, and used from any thread.
Constructors
| Name | Description |
|---|---|
| KeyboardLayoutProvider() |
KeyboardLayoutProvider()
KeyboardMap.cspublic KeyboardLayoutProvider()No documentation is available.
Properties
| Name | Description |
|---|---|
| Layout | Gets or sets the layout returned by the default implementation of KeyboardLayoutProvider.GetLayout: the key value (e.g. q) produced without modifier by each key, by code value (e.g. KeyQ). Only the writing system keys are reported to the documents. The default is KeyboardLayoutProvider.UsQwerty. Setting it fires the layoutchange event of the Keyboard objects of the documents. |
| UsQwerty | Gets the US QWERTY layout: the key produced without modifier by each writing system key (https://w3c.github.io/uievents-code/#key-alphanumeric-writing-system) of a US keyboard, by code value. |
Layout
KeyboardMap.csGets or sets the layout returned by the default implementation of KeyboardLayoutProvider.GetLayout: the key value (e.g. q) produced without modifier by each key, by code value (e.g. KeyQ). Only the writing system keys are reported to the documents. The default is KeyboardLayoutProvider.UsQwerty. Setting it fires the layoutchange event of the Keyboard objects of the documents.
public IReadOnlyDictionary<string, string> Layout { get; set; }Property value
UsQwerty
KeyboardMap.csGets the US QWERTY layout: the key produced without modifier by each writing system key (https://w3c.github.io/uievents-code/#key-alphanumeric-writing-system) of a US keyboard, by code value.
public static IReadOnlyDictionary<string, string> UsQwerty { get; }Property value
Methods
| Name | Description |
|---|---|
| GetLayout() | Returns the current layout of the keyboard: the key value produced without modifier by each key, by code value. |
| OnLayoutChanged() | Notifies the documents that the layout changed: their Keyboard objects fire the layoutchange event (a hidden document gets it when it becomes visible). It can be called from any thread. |
GetLayout()
KeyboardMap.csReturns the current layout of the keyboard: the key value produced without modifier by each key, by code value.
public virtual IReadOnlyDictionary<string, string> GetLayout()OnLayoutChanged()
KeyboardMap.csNotifies the documents that the layout changed: their Keyboard objects fire the layoutchange event (a hidden document gets it when it becomes visible). It can be called from any thread.
protected void OnLayoutChanged()Events
| Name | Description |
|---|---|
| LayoutChanged | Raised when the layout changes (KeyboardLayoutProvider.OnLayoutChanged). |
LayoutChanged
Raised when the layout changes (KeyboardLayoutProvider.OnLayoutChanged).
public event EventHandler? LayoutChanged