KeyboardLockOptions Class
The host hooks of the Keyboard Lock API (https://wicg.github.io/keyboard-lock/, BrowsingContextOptions.KeyboardLock).
public sealed class KeyboardLockOptionsConstructors
| Name | Description |
|---|---|
| KeyboardLockOptions() |
KeyboardLockOptions()
public KeyboardLockOptions()No documentation is available.
Properties
| Name | Description |
|---|---|
| Lock | Gets or sets the callback that registers the system key press handler (https://wicg.github.io/keyboard-lock/#system-key-press-handler) of a top-level document (navigator.keyboard.lock()), with the reserved key codes (the code values of the keys, e.g. KeyW; empty to capture all the keys): while the document is fullscreen, the host sends these keys to the document instead of handling them (e.g. Alt+Tab). A new call replaces the reserved key codes. The library checks the document (the active document of a top-level browsing context) and the key codes before calling it. The callback is invoked on the thread of the event loop, and must not block it. The default is null: no key is captured, but the promise is resolved (as in a browser whose page is not fullscreen). The first argument is the context of the window (see CallbackContext): its CallbackContext.Window is never null. |
| Unlock | Gets or sets the callback that unregisters the system key press handler registered by KeyboardLockOptions.Lock (navigator.keyboard.unlock(), or the document is unloaded). The callback is invoked on the thread of the event loop. The default is null. The first argument is the context of the window (see CallbackContext): its CallbackContext.Window is never null. |
Lock
KeyboardLock.csGets or sets the callback that registers the system key press handler (https://wicg.github.io/keyboard-lock/#system-key-press-handler) of a top-level document (navigator.keyboard.lock()), with the reserved key codes (the code values of the keys, e.g. KeyW; empty to capture all the keys): while the document is fullscreen, the host sends these keys to the document instead of handling them (e.g. Alt+Tab). A new call replaces the reserved key codes. The library checks the document (the active document of a top-level browsing context) and the key codes before calling it. The callback is invoked on the thread of the event loop, and must not block it. The default is null: no key is captured, but the promise is resolved (as in a browser whose page is not fullscreen). The first argument is the context of the window (see CallbackContext): its CallbackContext.Window is never null.
public Action<CallbackContext, IReadOnlyList<string>>? Lock { get; init; }Property value
Unlock
KeyboardLock.csGets or sets the callback that unregisters the system key press handler registered by KeyboardLockOptions.Lock (navigator.keyboard.unlock(), or the document is unloaded). The callback is invoked on the thread of the event loop. The default is null. The first argument is the context of the window (see CallbackContext): its CallbackContext.Window is never null.
public Action<CallbackContext>? Unlock { get; init; }