openharmony 鸿蒙 js-apis-inputdevice

2025-06-12 浏览 (1)

@ohos.multimodalInput.inputDevice (Input Device)

The inputDevice module implements input device management functions such as listening for the connection and disconnection of input devices and querying input device information such as the device name.

NOTE

The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.

Modules to Import

import { inputDevice } from '@kit.InputKit';

inputDevice.getDeviceList9+

getDeviceList(callback: AsyncCallback<Array<number>>): void

Obtains the IDs of all input devices. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.MultimodalInput.Input.InputDevice

Parameters

NameTypeMandatoryDescription
callbackAsyncCallback<Array<number>>YesCallback used to return the IDs of all input devices. id is the unique ID of an input device.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;2. Incorrect parameter types; 3. Parameter verification failed.

Example

try {
  inputDevice.getDeviceList((error: Error, ids: Array<Number>) => {
    if (error) {
      console.error(`Failed to get device id list, error: ${JSON.stringify(error, [`code`, `message`])}`);
      return;
    }
    console.log(`Device id list: ${JSON.stringify(ids)}`);
  });
} catch (error) {
  console.error(`Failed to get device id list, error: ${JSON.stringify(error, [`code`, `message`])}`);
}

inputDevice.getDeviceList9+

getDeviceList(): Promise<Array<number>>

Obtains the IDs of all input devices. This API uses a promise to return the result.

System capability: SystemCapability.MultimodalInput.Input.InputDevice

Return value

TypeDescription
Promise<Array<number>>Promise used to return the IDs of all input devices.

Example

try {
  inputDevice.getDeviceList().then((ids: Array<Number>) => {
    console.log(`Device id list: ${JSON.stringify(ids)}`);
  });
} catch (error) {
  console.error(`Failed to get device id list, error: ${JSON.stringify(error, [`code`, `message`])}`);
}

inputDevice.getDeviceInfo9+

getDeviceInfo(deviceId: number, callback: AsyncCallback<InputDeviceData>): void

Obtains information about the specified input device. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.MultimodalInput.Input.InputDevice

Parameters

NameTypeMandatoryDescription
deviceIdnumberYesID of the input device.
callbackAsyncCallback<InputDeviceData>YesCallback used to return information about the input device, including device ID, name, supported source, physical address, version information, and product information.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;2. Incorrect parameter types; 3. Parameter verification failed.

Example

// Obtain the name of the device whose ID is 1.
try {
  inputDevice.getDeviceInfo(1, (error: Error, deviceData: inputDevice.InputDeviceData) => {
    if (error) {
      console.error(`Failed to get device info, error: ${JSON.stringify(error, [`code`, `message`])}`);
      return;
    }
    console.log(`Device info: ${JSON.stringify(deviceData)}`);
  });
} catch (error) {
  console.error(`Failed to get device info, error: ${JSON.stringify(error, [`code`, `message`])}`);
}

inputDevice.getDeviceInfo9+

getDeviceInfo(deviceId: number): Promise<InputDeviceData>

Obtains the information about the input device with the specified ID. This API uses a promise to return the result.

System capability: SystemCapability.MultimodalInput.Input.InputDevice

Parameters

NameTypeMandatoryDescription
deviceIdnumberYesID of the input device.

Return value

TypeDescription
Promise<InputDeviceData>Promise used to return the information about the input device.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;2. Incorrect parameter types; 3. Parameter verification failed.

Example

// Obtain the name of the device whose ID is 1.
try {
  inputDevice.getDeviceInfo(1).then((deviceData: inputDevice.InputDeviceData) => {
    console.log(`Device info: ${JSON.stringify(deviceData)}`);
  });
} catch (error) {
  console.error(`Failed to get device info, error: ${JSON.stringify(error, [`code`, `message`])}`);
}

inputDevice.getDeviceInfoSync10+

getDeviceInfoSync(deviceId: number): InputDeviceData

Obtains information about the specified input device.

System capability: SystemCapability.MultimodalInput.Input.InputDevice

Parameters

NameTypeMandatoryDescription
deviceIdnumberYesID of the input device.

Return value

TypeDescription
InputDeviceDataInformation about the input device, including device ID, name, supported source, physical address, version information, and product information.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;2. Incorrect parameter types; 3. Parameter verification failed.

Example

// Obtain the name of the device whose ID is 1.
try {
  let deviceData: inputDevice.InputDeviceData = inputDevice.getDeviceInfoSync(1);
  console.log(`Device info: ${JSON.stringify(deviceData)}`);
} catch (error) {
  console.error(`Failed to get device info, error: ${JSON.stringify(error, [`code`, `message`])}`);
}

inputDevice.on9+

on(type: "change", listener: Callback<DeviceListener>): void

Enables listening for device hot swap events. When performing this operation, you need to connect to external devices such as a mouse, keyboard, and touchscreen.

System capability: SystemCapability.MultimodalInput.Input.InputDevice

Parameters

NameTypeMandatoryDescription
typestringYesEvent type. This field has a fixed value of change.
listenerCallback<DeviceListener>YesListener for events of the input device.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;2. Incorrect parameter types; 3. Parameter verification failed.

Example

let isPhysicalKeyboardExist = true;
try {
  inputDevice.on("change", (data: inputDevice.DeviceListener) => {
    console.log(`Device event info: ${JSON.stringify(data)}`);
    inputDevice.getKeyboardType(data.deviceId, (err: Error, type: inputDevice.KeyboardType) => {
      console.log("The keyboard type is: " + type);
      if (type == inputDevice.KeyboardType.ALPHABETIC_KEYBOARD && data.type == 'add') {
        // The physical keyboard is connected.
        isPhysicalKeyboardExist = true;
      } else if (type == inputDevice.KeyboardType.ALPHABETIC_KEYBOARD && data.type == 'remove') {
        // The physical keyboard is disconnected.
        isPhysicalKeyboardExist = false;
      }
    });
  });
  // Check whether the soft keyboard is open based on the value of isPhysicalKeyboardExist.
} catch (error) {
  console.error(`Get device info failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
}

inputDevice.off9+

off(type: "change", listener?: Callback<DeviceListener>): void

Disables listening for device hot swap events. This API is called before the application exits.

System capability: SystemCapability.MultimodalInput.Input.InputDevice

Parameters

NameTypeMandatoryDescription
typestringYesEvent type. This field has a fixed value of change.
listenerCallback<DeviceListener>NoCallback to unregister. If this parameter is left unspecified, listening for hot swap events of all input devices will be canceled.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;2. Incorrect parameter types; 3. Parameter verification failed.

Example

let callback = (data: inputDevice.DeviceListener) => {
  console.log(`Report device event info: ${JSON.stringify(data, [`type`, `deviceId`])}`);
};

try {
  inputDevice.on("change", callback);
} catch (error) {
  console.error(`Listen device event failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
}

// Disable this listener.
try {
  inputDevice.off("change", callback);
} catch (error) {
  console.error(`Cancel listening device event failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
}

// Disable all listeners.
try {
  inputDevice.off("change");
} catch (error) {
  console.error(`Cancel all listening device event failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
}

inputDevice.getDeviceIds(deprecated)

getDeviceIds(callback: AsyncCallback<Array<number>>): void

Obtains the IDs of all input devices. This API uses an asynchronous callback to return the result.

This API is deprecated since API version 9. You are advised to use inputDevice.getDeviceList instead.

System capability: SystemCapability.MultimodalInput.Input.InputDevice

Parameters

NameTypeMandatoryDescription
callbackAsyncCallback<Array<number>>YesCallback used to return the IDs of all input devices.

Example

inputDevice.getDeviceIds((error: Error, ids: Array<Number>) => {
  if (error) {
    console.error(`Failed to get device id list, error: ${JSON.stringify(error, [`code`, `message`])}`);
    return;
  }
  console.log(`Device id list: ${JSON.stringify(ids)}`);
});

inputDevice.getDeviceIds(deprecated)

getDeviceIds(): Promise<Array<number>>

Obtains the IDs of all input devices. This API uses a promise to return the result.

This API is deprecated since API version 9. You are advised to use inputDevice.getDeviceList instead.

System capability: SystemCapability.MultimodalInput.Input.InputDevice

Return value

TypeDescription
Promise<Array<number>>Promise used to return the IDs of all input devices.

Example

inputDevice.getDeviceIds().then((ids: Array<Number>) => {
  console.log(`Device id list: ${JSON.stringify(ids)}`);
});

inputDevice.getDevice(deprecated)

getDevice(deviceId: number, callback: AsyncCallback<InputDeviceData>): void

Obtains the information about the input device with the specified ID. This API uses an asynchronous callback to return the result.

This API is deprecated since API version 9. You are advised to use inputDevice.getDeviceInfo instead.

System capability: SystemCapability.MultimodalInput.Input.InputDevice

Parameters

NameTypeMandatoryDescription
deviceIdnumberYesID of the input device.
callbackAsyncCallback<InputDeviceData>YesCallback used to return the information about the input device.

Example

// Obtain the name of the device whose ID is 1.
inputDevice.getDevice(1, (error: Error, deviceData: inputDevice.InputDeviceData) => {
  if (error) {
    console.error(`Failed to get device info, error: ${JSON.stringify(error, [`code`, `message`])}`);
    return;
  }
  console.log(`Device info: ${JSON.stringify(deviceData)}`);
});

inputDevice.getDevice(deprecated)

getDevice(deviceId: number): Promise<InputDeviceData>

Obtains the information about the input device with the specified ID. This API uses a promise to return the result.

This API is deprecated since API version 9. You are advised to use inputDevice.getDeviceInfo instead.

System capability: SystemCapability.MultimodalInput.Input.InputDevice

Parameters

NameTypeMandatoryDescription
deviceIdnumberYesID of the input device.

Return value

TypeDescription
Promise<InputDeviceData>Promise used to return the information about the input device.

Example

// Obtain the name of the device whose ID is 1.
inputDevice.getDevice(1).then((deviceData: inputDevice.InputDeviceData) => {
  console.log(`Device info: ${JSON.stringify(deviceData)}`);
});

inputDevice.supportKeys9+

supportKeys(deviceId: number, keys: Array<KeyCode>, callback: AsyncCallback <Array<boolean>>): void

Checks whether the input device supports the specified keys. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.MultimodalInput.Input.InputDevice

Parameters

NameTypeMandatoryDescription
deviceIdnumberYesID of the input device. The device ID changes if the same physical device is repeatedly removed and inserted.
keysArray<KeyCode>YesKeycodes to be queried. A maximum of five keycodes can be specified.
callbackAsyncCallback<Array<boolean>>YesCallback used to return the result.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;2. Incorrect parameter types; 3. Parameter verification failed.

Example

// Check whether the input device whose ID is 1 supports keycodes 17, 22, and 2055.
try {
  inputDevice.supportKeys(1, [17, 22, 2055], (error: Error, supportResult: Array<Boolean>) => {
    console.log(`Query result: ${JSON.stringify(supportResult)}`);
  });
} catch (error) {
  console.error(`Query failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
}

inputDevice.supportKeys9+

supportKeys(deviceId: number, keys: Array<KeyCode>): Promise<Array<boolean>>

Checks whether the input device supports the specified keys. This API uses a promise to return the result.

System capability: SystemCapability.MultimodalInput.Input.InputDevice

Parameters

NameTypeMandatoryDescription
deviceIdnumberYesID of the input device. The device ID changes if the same physical device is repeatedly removed and inserted.
keysArray<KeyCode>YesKeycodes to be queried. A maximum of five keycodes can be specified.

Return value

TypeDescription
Promise<Array<boolean>>Promise used to return the result. The value true indicates that the keycodes are supported, and the value false indicates the opposite.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;2. Incorrect parameter types; 3. Parameter verification failed.

Example

// Check whether the input device whose ID is 1 supports keycodes 17, 22, and 2055.
try {
  inputDevice.supportKeys(1, [17, 22, 2055]).then((supportResult: Array<Boolean>) => {
    console.log(`Query result: ${JSON.stringify(supportResult)}`);
  });
} catch (error) {
  console.error(`Query failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
}

inputDevice.supportKeysSync10+

supportKeysSync(deviceId: number, keys: Array<KeyCode>): Array<boolean>

Checks whether the input device supports the specified keys.

System capability: SystemCapability.MultimodalInput.Input.InputDevice

Parameters

NameTypeMandatoryDescription
deviceIdnumberYesID of the input device. The device ID changes if the same physical device is repeatedly removed and inserted.
keysArray<KeyCode>YesKeycodes to be queried. A maximum of five keycodes can be specified.

Return value

TypeDescription
Array<boolean>Result indicating whether the input device supports the keycode value. The value true indicates yes, and the value false indicates no.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;2. Incorrect parameter types; 3. Parameter verification failed.

Example

// Check whether the input device whose ID is 1 supports keycodes 17, 22, and 2055.
try {
  let supportResult: Array<Boolean> = inputDevice.supportKeysSync(1, [17, 22, 2055])
  console.log(`Query result: ${JSON.stringify(supportResult)}`)
} catch (error) {
  console.error(`Query failed, error: ${JSON.stringify(error, [`code`, `message`])}`)
}

inputDevice.getKeyboardType9+

getKeyboardType(deviceId: number, callback: AsyncCallback<KeyboardType>): void

Obtains the keyboard type of the input device, such as full keyboard and numeric keypad. This API uses an asynchronous callback to return the result. The keyboard type of the input device is subject to the result returned by the API.

System capability: SystemCapability.MultimodalInput.Input.InputDevice

Parameters

NameTypeMandatoryDescription
deviceIdnumberYesUnique ID of the input device. If the same physical device is repeatedly reinstalled or restarted, its ID may change.
callbackAsyncCallback<KeyboardType>YesCallback used to return the result.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;2. Incorrect parameter types; 3. Parameter verification failed.

Example

// Query the keyboard type of the input device whose ID is 1.
try {
  inputDevice.getKeyboardType(1, (error: Error, type: Number) => {
    if (error) {
      console.error(`Failed to get keyboard type, error: ${JSON.stringify(error, [`code`, `message`])}`);
      return;
    }
    console.log(`Keyboard type: ${JSON.stringify(type)}`);
  });
} catch (error) {
  console.error(`Failed to get keyboard type, error: ${JSON.stringify(error, [`code`, `message`])}`);
}

inputDevice.getKeyboardType9+

getKeyboardType(deviceId: number): Promise<KeyboardType>

Obtains the keyboard type of an input device. This API uses a promise to return the result.

System capability: SystemCapability.MultimodalInput.Input.InputDevice

Parameters

NameTypeMandatoryDescription
deviceIdnumberYesUnique ID of the input device. If the same physical device is repeatedly reinstalled or restarted, its ID may change.

Return value

TypeDescription
Promise<KeyboardType>Promise used to return the result.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;2. Incorrect parameter types; 3. Parameter verification failed.

Example

// Query the keyboard type of the input device whose ID is 1.
try {
  inputDevice.getKeyboardType(1).then((type: Number) => {
    console.log(`Keyboard type: ${JSON.stringify(type)}`);
  });
} catch (error) {
  console.error(`Failed to get keyboard type, error: ${JSON.stringify(error, [`code`, `message`])}`);
}

inputDevice.getKeyboardTypeSync10+

getKeyboardTypeSync(deviceId: number): KeyboardType

Obtains the keyboard type of the input device.

System capability: SystemCapability.MultimodalInput.Input.InputDevice

Parameters

NameTypeMandatoryDescription
deviceIdnumberYesUnique ID of the input device. If the same physical device is repeatedly reinstalled or restarted, its ID may change.

Return value

TypeDescription
KeyboardTypeKeyboard type.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;2. Incorrect parameter types; 3. Parameter verification failed.

Example

// Query the keyboard type of the input device whose ID is 1.
try {
  let type: number = inputDevice.getKeyboardTypeSync(1)
  console.log(`Keyboard type: ${JSON.stringify(type)}`)
} catch (error) {
  console.error(`Failed to get keyboard type, error: ${JSON.stringify(error, [`code`, `message`])}`)
}

inputDevice.isFunctionKeyEnabled15+

isFunctionKeyEnabled(functionKey: FunctionKey): Promise<boolean>

Checks whether the specified function key (for example, CapsLock) is enabled. This API uses a promise to return the result.

System capability: SystemCapability.MultimodalInput.Input.InputDevice

Parameters

NameTypeMandatoryDescription
functionKeyFunctionKeyYesType of the function key.

Return value

TypeDescription
Promise<boolean>Promise used to return the result. The value true indicates that the function key is enabled, and the value false indicates the opposite.

Error codes

For details about the error codes, see Universal Error Codes and Input Device Error Codes.

IDError Message
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;2. Incorrect parameter types; 3. Parameter verification failed.
3900002There is currently no keyboard device connected.

Example

import { inputDevice } from '@kit.InputKit';

try {
  inputDevice.isFunctionKeyEnabled(inputDevice.FunctionKey.CAPS_LOCK).then((state: boolean) => {
    console.log(`capslock state: ${JSON.stringify(state)}`);
  });
} catch (error) {
  console.error(`Failed to get capslock state, error: ${JSON.stringify(error, [`code`, `message`])}`);
}

inputDevice.setFunctionKeyEnabled15+

setFunctionKeyEnabled(functionKey: FunctionKey, enabled: boolean): Promise<void>

Specifies whether to enable a function key (for example, CapsLock). This API uses a promise to return the result.

Required permissions: ohos.permission.INPUT_KEYBOARD_CONTROLLER

System capability: SystemCapability.MultimodalInput.Input.InputDevice

Parameters

NameTypeMandatoryDescription
functionKeyFunctionKeyYesType of the function key.
enabledbooleanYesStatus of the function key. The value true indicates that the function key is enabled, and the value false indicates the opposite.

Error codes

For details about the error codes, see Universal Error Codes and Input Device Error Codes.

IDError Message
201Permission denied.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;2. Incorrect parameter types; 3. Parameter verification failed.
3900002There is currently no keyboard device connected.
3900003It is prohibited for non-input applications.

Example

import { inputDevice } from '@kit.InputKit';
import { BusinessError } from '@kit.BasicServicesKit';

try {
  inputDevice.setFunctionKeyEnabled(inputDevice.FunctionKey.CAPS_LOCK, true).then(() => {
    console.info(`Set capslock state success`);
  }).catch((error: BusinessError) => {
    console.error(`Set capslock state failed, error=${JSON.stringify(error)}`);
  });
} catch (error) {
    console.error(`Set capslock enable error`);
}

inputDevice.getIntervalSinceLastInput14+

getIntervalSinceLastInput(): Promise<number>

Obtains the interval (including the device sleep time) elapsed since the last system input event. This API uses a promise to return the result.

System capability: SystemCapability.MultimodalInput.Input.InputDevice

Return value

ParametersDescription
Promise<number>Promise used to return the interval since the last system input event, in μs.

Example

  inputDevice.getIntervalSinceLastInput().then((timeInterval: number) => {
    console.log(`Interval since last input: ${JSON.stringify(timeInterval)}`);
  });

DeviceListener9+

Provides hot swap information about an input device.

System capability: SystemCapability.MultimodalInput.Input.InputDevice

NameTypeReadableWritableDescription
typeChangedTypeYesNoDevice change type, which indicates whether an input device is inserted or removed.
deviceIdnumberYesNoUnique ID of the input device. If a physical device is repeatedly reinstalled or restarted, its ID may change.

InputDeviceData

Provides information about an input device.

System capability: SystemCapability.MultimodalInput.Input.InputDevice

NameTypeReadableWritableDescription
idnumberYesNoUnique ID of the input device. If the same physical device is repeatedly reinstalled or restarted, its ID may change.
namestringYesNoName of the input device.
sourcesArray<SourceType>YesNoInput sources supported by the input device. An input device can have multiple input sources. For example, if a keyboard is equipped with a touchpad, the input device supports both keyboard and touchpad input capabilities.
axisRangesArray<AxisRange>YesNoAxis information of the input device.
bus9+numberYesNoBus type of the input device. By default, the bus type reported by the input device prevails.
product9+numberYesNoProduct information of the input device.
vendor9+numberYesNoVendor information of the input device.
version9+numberYesNoVersion information of the input device.
phys9+stringYesNoPhysical address of the input device.
uniq9+stringYesNoUnique ID of the input device.

AxisType9+

type AxisType = 'touchmajor'|'touchminor'|'orientation'|'x'|'y'|'pressure'|'toolminor'|'toolmajor'|'null'

Defines the axis type of an input device.

System capability: SystemCapability.MultimodalInput.Input.InputDevice

TypeDescription
'touchmajor'Major axis of the elliptical touching area.
'touchminor'Minor axis of the elliptical touching area.
'toolminor'Minor axis of the tool area.
'toolmajor'Major axis of the tool area.
'orientation'Orientation axis.
'pressure'Pressure axis.
'x'Horizontal axis.
'y'Vertical axis.
'null'None.

AxisRange

Defines the axis range of an input device.

System capability: SystemCapability.MultimodalInput.Input.InputDevice

NameTypeReadableWritableDescription
sourceSourceTypeYesNoInput source of the axis.
axisAxisTypeYesNoAxis type.
maxnumberYesNoMaximum value of the axis.
minnumberYesNoMinimum value of the axis.
fuzz9+numberYesNoFuzzy value of the axis.
flat9+numberYesNoBenchmark value of the axis.
resolution9+numberYesNoResolution of the axis.

SourceType9+

type SourceType = 'keyboard'|'mouse'|'touchpad'|'touchscreen'|'joystick'|'trackball'

Enumerates input sources of the axis. For example, if a mouse reports an x-axis event, the input source of the x-axis is the mouse.

System capability: SystemCapability.MultimodalInput.Input.InputDevice

TypeDescription
'keyboard'The input device is a keyboard.
'touchscreen'The input device is a touchscreen.
'mouse'The input device is a mouse.
'trackball'The input device is a trackball.
'touchpad'The input device is a touchpad.
'joystick'The input device is a joystick.

ChangedType9+

type ChangedType = 'add'|'remove'

Enumerates hot swap events.

System capability: SystemCapability.MultimodalInput.Input.InputDevice

TypeDescription
'add'Device insertion.
'remove'Device removal.

KeyboardType9+

Enumerates keyboard types.

System capability: SystemCapability.MultimodalInput.Input.InputDevice

NameValueDescription
NONE0Keyboard without keys.
UNKNOWN1Keyboard with unknown keys.
ALPHABETIC_KEYBOARD2Full keyboard.
DIGITAL_KEYBOARD3Keypad.
HANDWRITING_PEN4Stylus.
REMOTE_CONTROL5Remote control.

FunctionKey15+

Enumerates function key types.

System capability: SystemCapability.MultimodalInput.Input.InputDevice

NameValueDescription
CAPS_LOCK1CapsLock key. This key can be enabled or disabled only for the input keyboard extension.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Input Kit

harmony 鸿蒙Input_DeviceListener

harmony 鸿蒙Input_InterceptorEventCallback

harmony 鸿蒙Input_AxisEvent

harmony 鸿蒙Input_DeviceInfo

harmony 鸿蒙Input_DeviceListener

harmony 鸿蒙Input_Hotkey

harmony 鸿蒙Input_InterceptorEventCallback

harmony 鸿蒙Input_InterceptorOptions

harmony 鸿蒙Input_KeyEvent

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/tWFvTj