diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts index ab4051ef4e817e1562a7775b741178c0b3c32224..139a11db8ebd99aab2275428c61317d82c391b4b 100755 --- a/api/@ohos.multimodalInput.inputDevice.d.ts +++ b/api/@ohos.multimodalInput.inputDevice.d.ts @@ -69,6 +69,26 @@ declare namespace inputDevice { REMOTE_CONTROL = 5, } + /** + * @since 10 + */ + enum FunctionKey { + /** + * 大小写切换键 + */ + CAPSLOCK = 0, + + /** + * 小键盘使能键 + */ + NUMLOCK = 1, + + /** + * 滚动锁定键 + */ + SCROLLOCK = 2, + } + /** * Defines the listener for input device events. * @@ -249,7 +269,7 @@ declare namespace inputDevice { * @param keys Key codes of the input device, You can query a maximum of five key codes at a time. * @return Returns a result indicating whether the specified key codes are supported. */ - function supportKeys(deviceId: number, keys: Array, callback: Callback>): void; + function supportKeys(deviceId: number, keys: Array, callback: AsyncCallback>): void; function supportKeys(deviceId: number, keys: Array): Promise>; /** @@ -262,6 +282,28 @@ declare namespace inputDevice { */ function getKeyboardType(deviceId: number, callback: AsyncCallback): void; function getKeyboardType(deviceId: number): Promise; + + /** + * 获取键盘设备指定功能按键的使能状态. + * + * @since 10 + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @param key 功能按键的键值码. + * @return 返回指定功能按键的使能状态. + */ + function getFunctionKeyState(key: FunctionKey, callback: AsyncCallback): void; + function getFunctionKeyState(key: FunctionKey): Promise; + + /** + * 设置键盘设备指定功能键的使能状态. + * + * @since 10 + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @param key 功能按键的键值码. + * @param state 待设置的使能状态 . + */ + function setFunctionKeyState(key: FunctionKey, state: boolean, callback: AsyncCallback): void; + function setFunctionKeyState(key: FunctionKey, state: boolean): Promise; } export default inputDevice; \ No newline at end of file