Class Keyboard
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
NOTE
ExperimentalKeyboard interface of the {{domxref("Keyboard API", "", "", "nocode")}} provides functions that retrieve keyboard layout maps and toggle capturing of key presses from the physical keyboard.
[Value("Keyboard")]
public class Keyboard : EventTarget
- Inheritance
-
Keyboard
- Inherited Members
Remarks
A list of valid code values is found in the UI Events KeyboardEvent code Values spec.
Constructors
Keyboard()
public Keyboard()
Properties
Onlayoutchange
[Value("onlayoutchange")]
public EventHandlerNonNull Onlayoutchange { get; set; }
Property Value
Methods
GetLayoutMap()
NOTE
ExperimentalgetLayoutMap() method of theKeyboard interface returns a {{jsxref('Promise')}} that resolves with
an instance of 'KeyboardLayoutMap' which is a map-like object with
functions for retrieving the strings associated with specific physical keys.
[Value("getLayoutMap")]
public Task<KeyboardLayoutMap> GetLayoutMap()
Returns
- Task<KeyboardLayoutMap>
A 'Promise' that resolves with an instance of
'KeyboardLayoutMap'.
Remarks
-Intl
Lock(List<string>)
NOTE
Experimentallock() method of theKeyboard interface returns a {{jsxref('Promise')}} that resolves after enabling the
capture of key presses for any or all of the keys on the physical keyboard. This method
can only capture keys that are granted access by the underlying operating
system.
[Value("lock")]
public Task<GlobalObject.Undefined> Lock(List<string> keyCodes = null)
Parameters
Returns
- Task<GlobalObject.Undefined>
A 'Promise' that resolves with 'undefined' when the lock was successful.
Remarks
If lock() is called multiple times then only the key codes specified in the most recent call will be locked.
Any keys locked by a previous call to lock() are unlocked.
Unlock()
NOTE
Experimentalunlock() method of theKeyboard interface unlocks all keys captured by the
'Keyboard.Lock' method and returns synchronously.
[Value("unlock")]
public GlobalObject.Undefined Unlock()