# class KeyTools

    @Keep
     class KeyTools

Package: | dji.sdk.keyvalue.key

##### Description:

Key tool class. DJI encapsulates a series of more concise and easy-to-use methods to create `DJIKey` instance.
`Supported since MSDK 5.0.0`

##### Class Members:

method
createKey

###### method createKey

    @NonNull
     static <T> DJIKey<T> createKey(DJIKeyInfo<T> mKeyInfo, int productId, int componentIndex, int subComponentType, int subComponentIndex)

Package: | dji.sdk.keyvalue.key

##### Description:

The default method for creating Key instances.
`Supported since MSDK 5.0.0`

##### Input Parameters:

DJIKeyInfo<T> mKeyInfo | A key interface in `DJIKey`. For example, CameraKey.`KeyCameraType`, which represents the key of the camera type.
int productId | Product ID of the currently connected device, defaults to 0.
int componentIndex | Gimbal load position. Please refer to `ComponentIndexType` to set the corresponding int value.
int subComponentType | Camera lens type. Please refer to `CameraLensType` to set the corresponding int value.
int subComponentIndex | Reserved parameter.

##### Return:

static <T> DJIKey<T> | Return instance of `DJIKey`.

method
createKey

###### method createKey

    @NonNull
     static <T> DJIKey<T> createKey(DJIKeyInfo<T> mKeyInfo)

Package: | dji.sdk.keyvalue.key

##### Description:

Create a Key instance by passing a `DJIKeyInfo` instance of a Key interface. This method is suitable for instance creation of keys that have nothing to do with the gimbal load and camera.
`Supported since MSDK 5.0.0`

##### Input Parameters:

DJIKeyInfo<T> mKeyInfo | A key interface in `DJIKey`. For example, FlightControllerKey.`KeyAircraftAttitude`, which represents the key to get the aircraft attitude.

##### Return:

static <T> DJIKey<T> | Return instance of `DJIKey`.

method
createKey

###### method createKey

    @NonNull
     static <T> DJIKey<T> createKey(DJIKeyInfo<T> mKeyInfo, @NonNull ComponentIndexType componentIndexType)

Package: | dji.sdk.keyvalue.key

##### Description:

Create a Key instance by passing in the `DJIKeyInfo` instance of a Key interface and the load position of the gimbal. This method is suitable for instance creation of keys related to the gimbal load.
`Supported since MSDK 5.0.0`

##### Input Parameters:

DJIKeyInfo<T> mKeyInfo | A key interface in `DJIKey`. For example, GimbalKey.`KeyGimbalReset`, which represents the key to reset the gimbal.
@NonNull ComponentIndexType componentIndexType | Gimbal load position.

##### Return:

static <T> DJIKey<T> | Return instance of `DJIKey`.

method
createCameraKey

###### method createCameraKey

    @NonNull
     static <T> DJIKey<T> createCameraKey(DJIKeyInfo<T> mKeyInfo, ComponentIndexType componentIndexType, CameraLensType cameraLensType)

Package: | dji.sdk.keyvalue.key

##### Description:

Create a Key instance by passing in the `DJIKeyInfo` instance of a Key interface, camera lens type and the load position of the gimbal. This method is suitable for instance creation of keys related to the camera.
`Supported since MSDK 5.0.0`

##### Input Parameters:

DJIKeyInfo<T> mKeyInfo | A key interface in `DJIKey`. For example, CameraKey.`KeyCameraType`, which represents the key of the camera type.
ComponentIndexType componentIndexType | Gimbal load position.
CameraLensType cameraLensType | Camera lens type.

##### Return:

static <T> DJIKey<T> | Return instance of `DJIKey`.

method
createKey

###### method createKey

    @NonNull
     static <T, R> DJIKey.ActionKey<T, R> createKey(DJIActionKeyInfo<T, R> mKeyInfo, int productId, int componentIndex, int subComponentType, int subComponentIndex)

Package: | dji.sdk.keyvalue.key

##### Description:

The default method for creating an ActionKey instance.
`Supported since MSDK 5.0.0`

##### Input Parameters:

DJIActionKeyInfo<T, R> mKeyInfo | A key interface in `DJIKey`. For example, CameraKey.`KeyCameraType`, which represents the key of the camera type.
int productId | Product ID of the currently connected device, defaults to 0.
int componentIndex | Gimbal load position. Please refer to `ComponentIndexType` to set the corresponding int value.
int subComponentType | Camera lens type. Please refer to `CameraLensType` to set the corresponding int value.
int subComponentIndex | Reserved parameter.

##### Return:

static <T, R> DJIKey.ActionKey<T, R> | Return instance of `DJIKey`.

method
createKey

###### method createKey

    @NonNull
     static <T, R> DJIKey.ActionKey<T, R> createKey(DJIActionKeyInfo<T, R> mKeyInfo)

Package: | dji.sdk.keyvalue.key

##### Description:

Create an ActionKey instance by passing in a DJIKeyInfo instance of a Key interface. This method is suitable for instance creation of ActionKey which is not related to gimbal load and camera.
`Supported since MSDK 5.0.0`

##### Input Parameters:

DJIActionKeyInfo<T, R> mKeyInfo | A key interface in `DJIKey`. For example, CameraKey.`KeyCameraType`, which represents the key of the camera type.

##### Return:

static <T, R> DJIKey.ActionKey<T, R> | Return instance of `DJIKey`.

method
createKey

###### method createKey

    static <T, R> DJIKey.ActionKey<T, R> createKey(DJIActionKeyInfo<T, R> mKeyInfo, ComponentIndexType componentIndexType)

Package: | dji.sdk.keyvalue.key

##### Description:

Create a Key instance by passing in the `DJIKeyInfo` instance of an ActionKey interface and the load position of the gimbal. This method is suitable for instance creation of ActionKey related to gimbal load.
`Supported since MSDK 5.0.0`

##### Input Parameters:

DJIActionKeyInfo<T, R> mKeyInfo | A key interface in `DJIKey`. For example, CameraKey.`KeyCameraType`, which represents the key of the camera type.
ComponentIndexType componentIndexType | Gimbal load position.

##### Return:

static <T, R> DJIKey.ActionKey<T, R> | Return instance of `DJIKey`.

method
createCameraKey

###### method createCameraKey

    @NonNull
     static <T, R> DJIKey.ActionKey<T, R> createCameraKey(DJIActionKeyInfo<T, R> mKeyInfo, ComponentIndexType componentIndexType, CameraLensType cameraLensType)

Package: | dji.sdk.keyvalue.key

##### Description:

Create a Key instance by passing in the `DJIKeyInfo` instance of an ActionKey interface, camera lens type and the load position of the gimbal. This method is suitable for instance creation of ActionKey related to camera.

##### Input Parameters:

DJIActionKeyInfo<T, R> mKeyInfo | A key interface in `DJIKey`. For example, CameraKey.`KeyCameraType`, which represents the key of the camera type.
ComponentIndexType componentIndexType | Gimbal load position.
CameraLensType cameraLensType | Camera lens type.

##### Return:

static <T, R> DJIKey.ActionKey<T, R> | Return instance of `DJIKey`.

##### Related:

class
DJIKeyInfo
enum
ComponentIndexType

###### enum ComponentIndexType

    enum ComponentIndexType implements JNIProguardKeepTag

Package: | dji.sdk.keyvalue.value.common

##### Description:

Gimbal load position.

##### Enum Members:

LEFT_OR_MAIN | Portside(Main) position.
RIGHT | Starboard position.
UP | Upside location.
FPV | Nose（FPV）location.

##### Class Members:

enum
CameraLensType

###### enum CameraLensType

    enum CameraLensType implements JNIProguardKeepTag

Package: | dji.sdk.keyvalue.value.common

##### Description:

Type of camera lens.

##### Enum Members:

CAMERA_LENS_ZOOM | Zoom lens.
CAMERA_LENS_WIDE | Wide lens.
CAMERA_LENS_THERMAL | Thermal lens.
CAMERA_LENS_RGB | Multispectral RGB lenses.
CAMERA_LENS_MS_NDVI | Multispectral NDVI lenses.
CAMERA_LENS_MS_G | Multispectral G lenses.
CAMERA_LENS_MS_R | Multispectral R lenses.
CAMERA_LENS_MS_RE | Multispectral RE lenses.
CAMERA_LENS_MS_NIR | Multispectral NIR lenses.
CAMERA_LENS_DEFAULT | Default lens. For cameras with only one lens, there is no need to distinguish between zoom, wide or infrared lenses. Use this default lens type.

##### Class Members:

×

## Search Mobile SDK Document

{{searchCount}} Results

- ### {{{(item.highlights && item.highlights.title) || item.title}}}

  {{{(item.highlights && item.highlights.content[0]) || item.title}}}

Load More
Loading...
Not Found