1e41f4b71Sopenharmony_ci# @ohos.multimodalInput.inputDevice (Input Device) (System API)
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci
4e41f4b71Sopenharmony_ciThe **inputDevice** module allows you to listen for hot swap events of input devices and query information about input devices.
5e41f4b71Sopenharmony_ci
6e41f4b71Sopenharmony_ci
7e41f4b71Sopenharmony_ci> **NOTE**
8e41f4b71Sopenharmony_ci>
9e41f4b71Sopenharmony_ci> 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.
10e41f4b71Sopenharmony_ci>
11e41f4b71Sopenharmony_ci> This topic describes only system APIs provided by the module. For details about its public APIs, see [@ohos.multimodalInput.inputDevice (Input Device)](js-apis-inputdevice.md).
12e41f4b71Sopenharmony_ci
13e41f4b71Sopenharmony_ci
14e41f4b71Sopenharmony_ci## Modules to Import
15e41f4b71Sopenharmony_ci
16e41f4b71Sopenharmony_ci```js
17e41f4b71Sopenharmony_ciimport { inputDevice } from '@kit.InputKit';
18e41f4b71Sopenharmony_ci```
19e41f4b71Sopenharmony_ci
20e41f4b71Sopenharmony_ci## inputDevice.setKeyboardRepeatDelay<sup>10+</sup>
21e41f4b71Sopenharmony_ci
22e41f4b71Sopenharmony_cisetKeyboardRepeatDelay(delay: number, callback: AsyncCallback&lt;void&gt;): void
23e41f4b71Sopenharmony_ci
24e41f4b71Sopenharmony_ciSets the keyboard repeat delay. This API uses an asynchronous callback to return the result.
25e41f4b71Sopenharmony_ci
26e41f4b71Sopenharmony_ci**System capability**: SystemCapability.MultimodalInput.Input.InputDevice
27e41f4b71Sopenharmony_ci
28e41f4b71Sopenharmony_ci**System API**: This is a system API.
29e41f4b71Sopenharmony_ci
30e41f4b71Sopenharmony_ci**Parameters**
31e41f4b71Sopenharmony_ci
32e41f4b71Sopenharmony_ci| Name    | Type  | Mandatory| Description                                                        |
33e41f4b71Sopenharmony_ci| -------- | ------ | ---- | ------------------------------------------------------------ |
34e41f4b71Sopenharmony_ci| delay    | number                    | Yes   | Keyboard repeat delay, in ms. The value range is [300, 1000] and the default value is **500**.|
35e41f4b71Sopenharmony_ci| callback | AsyncCallback&lt;void&gt; | Yes   | Callback used to return the result.|
36e41f4b71Sopenharmony_ci
37e41f4b71Sopenharmony_ci**Error codes**
38e41f4b71Sopenharmony_ci
39e41f4b71Sopenharmony_ciFor details about the error codes, see [Universal Error Codes](../errorcode-universal.md).
40e41f4b71Sopenharmony_ci
41e41f4b71Sopenharmony_ci| ID | Error Message            |
42e41f4b71Sopenharmony_ci| ---- | --------------------- |
43e41f4b71Sopenharmony_ci| 401  | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;2. Incorrect parameter types; 3. Parameter verification failed. |
44e41f4b71Sopenharmony_ci
45e41f4b71Sopenharmony_ci**Example**
46e41f4b71Sopenharmony_ci
47e41f4b71Sopenharmony_ci```js
48e41f4b71Sopenharmony_citry {
49e41f4b71Sopenharmony_ci  inputDevice.setKeyboardRepeatDelay(350, (error: Error) => {
50e41f4b71Sopenharmony_ci    if (error) {
51e41f4b71Sopenharmony_ci      console.log(`Set keyboard repeat delay failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
52e41f4b71Sopenharmony_ci      return;
53e41f4b71Sopenharmony_ci    }
54e41f4b71Sopenharmony_ci    console.log(`Set keyboard repeat delay success`);
55e41f4b71Sopenharmony_ci  });
56e41f4b71Sopenharmony_ci} catch (error) {
57e41f4b71Sopenharmony_ci  console.log(`Set keyboard repeat delay failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
58e41f4b71Sopenharmony_ci}
59e41f4b71Sopenharmony_ci```
60e41f4b71Sopenharmony_ci
61e41f4b71Sopenharmony_ci## inputDevice.setKeyboardRepeatDelay<sup>10+</sup>
62e41f4b71Sopenharmony_ci
63e41f4b71Sopenharmony_cisetKeyboardRepeatDelay(delay: number): Promise&lt;void&gt;
64e41f4b71Sopenharmony_ci
65e41f4b71Sopenharmony_ciSets the keyboard repeat delay. This API uses a promise to return the result.
66e41f4b71Sopenharmony_ci
67e41f4b71Sopenharmony_ci**System capability**: SystemCapability.MultimodalInput.Input.InputDevice
68e41f4b71Sopenharmony_ci
69e41f4b71Sopenharmony_ci**System API**: This is a system API.
70e41f4b71Sopenharmony_ci
71e41f4b71Sopenharmony_ci**Parameters**
72e41f4b71Sopenharmony_ci
73e41f4b71Sopenharmony_ci| Name   | Type    | Mandatory  | Description                                 |
74e41f4b71Sopenharmony_ci| ----- | ------ | ---- | ----------------------------------- |
75e41f4b71Sopenharmony_ci| delay | number | Yes   | Keyboard repeat delay, in ms. The value range is [300, 1000] and the default value is **500**.|
76e41f4b71Sopenharmony_ci
77e41f4b71Sopenharmony_ci**Return value**
78e41f4b71Sopenharmony_ci
79e41f4b71Sopenharmony_ci| Parameters                 | Description              |
80e41f4b71Sopenharmony_ci| ------------------- | ---------------- |
81e41f4b71Sopenharmony_ci| Promise&lt;void&gt; | Promise used to return the result.|
82e41f4b71Sopenharmony_ci
83e41f4b71Sopenharmony_ci**Error codes**
84e41f4b71Sopenharmony_ci
85e41f4b71Sopenharmony_ciFor details about the error codes, see [Universal Error Codes](../errorcode-universal.md).
86e41f4b71Sopenharmony_ci
87e41f4b71Sopenharmony_ci| ID | Error Message            |
88e41f4b71Sopenharmony_ci| ---- | --------------------- |
89e41f4b71Sopenharmony_ci| 401  | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;2. Incorrect parameter types; 3. Parameter verification failed. |
90e41f4b71Sopenharmony_ci
91e41f4b71Sopenharmony_ci**Example**
92e41f4b71Sopenharmony_ci
93e41f4b71Sopenharmony_ci```js
94e41f4b71Sopenharmony_citry {
95e41f4b71Sopenharmony_ci  inputDevice.setKeyboardRepeatDelay(350).then(() => {
96e41f4b71Sopenharmony_ci    console.log(`Set keyboard repeat delay success`);
97e41f4b71Sopenharmony_ci  });
98e41f4b71Sopenharmony_ci} catch (error) {
99e41f4b71Sopenharmony_ci  console.log(`Set keyboard repeat delay failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
100e41f4b71Sopenharmony_ci}
101e41f4b71Sopenharmony_ci```
102e41f4b71Sopenharmony_ci
103e41f4b71Sopenharmony_ci## inputDevice.getKeyboardRepeatDelay<sup>10+</sup>
104e41f4b71Sopenharmony_ci
105e41f4b71Sopenharmony_cigetKeyboardRepeatDelay(callback: AsyncCallback&lt;number&gt;): void
106e41f4b71Sopenharmony_ci
107e41f4b71Sopenharmony_ciObtains the keyboard repeat delay. This API uses an asynchronous callback to return the result.
108e41f4b71Sopenharmony_ci
109e41f4b71Sopenharmony_ci**System capability**: SystemCapability.MultimodalInput.Input.InputDevice
110e41f4b71Sopenharmony_ci
111e41f4b71Sopenharmony_ci**System API**: This is a system API.
112e41f4b71Sopenharmony_ci
113e41f4b71Sopenharmony_ci**Parameters**
114e41f4b71Sopenharmony_ci
115e41f4b71Sopenharmony_ci| Name    | Type  | Mandatory| Description                                                        |
116e41f4b71Sopenharmony_ci| -------- | ------ | ---- | ------------------------------------------------------------ |
117e41f4b71Sopenharmony_ci| callback   | AsyncCallback&lt;number&gt;                    | Yes   | Callback used to return the result.|
118e41f4b71Sopenharmony_ci
119e41f4b71Sopenharmony_ci**Error codes**
120e41f4b71Sopenharmony_ci
121e41f4b71Sopenharmony_ciFor details about the error codes, see [Universal Error Codes](../errorcode-universal.md).
122e41f4b71Sopenharmony_ci
123e41f4b71Sopenharmony_ci| ID | Error Message            |
124e41f4b71Sopenharmony_ci| ---- | --------------------- |
125e41f4b71Sopenharmony_ci| 202  | SystemAPI permission error |
126e41f4b71Sopenharmony_ci| 401  | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;2. Incorrect parameter types; 3. Parameter verification failed. |
127e41f4b71Sopenharmony_ci
128e41f4b71Sopenharmony_ci**Example**
129e41f4b71Sopenharmony_ci
130e41f4b71Sopenharmony_ci```js
131e41f4b71Sopenharmony_citry {
132e41f4b71Sopenharmony_ci  inputDevice.getKeyboardRepeatDelay((error: Error, delay: Number) => {
133e41f4b71Sopenharmony_ci    if (error) {
134e41f4b71Sopenharmony_ci      console.log(`Get keyboard repeat delay failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
135e41f4b71Sopenharmony_ci      return;
136e41f4b71Sopenharmony_ci    }
137e41f4b71Sopenharmony_ci    console.log(`Get keyboard repeat delay success`);
138e41f4b71Sopenharmony_ci  });
139e41f4b71Sopenharmony_ci} catch (error) {
140e41f4b71Sopenharmony_ci  console.log(`Get keyboard repeat delay failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
141e41f4b71Sopenharmony_ci}
142e41f4b71Sopenharmony_ci```
143e41f4b71Sopenharmony_ci
144e41f4b71Sopenharmony_ci## inputDevice.getKeyboardRepeatDelay<sup>10+</sup>
145e41f4b71Sopenharmony_ci
146e41f4b71Sopenharmony_cigetKeyboardRepeatDelay(): Promise&lt;number&gt;
147e41f4b71Sopenharmony_ci
148e41f4b71Sopenharmony_ciObtains the keyboard repeat delay. This API uses a promise to return the result.
149e41f4b71Sopenharmony_ci
150e41f4b71Sopenharmony_ci**System capability**: SystemCapability.MultimodalInput.Input.InputDevice
151e41f4b71Sopenharmony_ci
152e41f4b71Sopenharmony_ci**System API**: This is a system API.
153e41f4b71Sopenharmony_ci
154e41f4b71Sopenharmony_ci**Return value**
155e41f4b71Sopenharmony_ci
156e41f4b71Sopenharmony_ci| Parameters                   | Description                 |
157e41f4b71Sopenharmony_ci| --------------------- | ------------------- |
158e41f4b71Sopenharmony_ci| Promise&lt;number&gt; | Promise used to return the result.|
159e41f4b71Sopenharmony_ci
160e41f4b71Sopenharmony_ci**Error codes**
161e41f4b71Sopenharmony_ci
162e41f4b71Sopenharmony_ciFor details about the error codes, see [Universal Error Codes](../errorcode-universal.md).
163e41f4b71Sopenharmony_ci
164e41f4b71Sopenharmony_ci| ID | Error Message            |
165e41f4b71Sopenharmony_ci| ---- | --------------------- |
166e41f4b71Sopenharmony_ci| 202  | SystemAPI permission error |
167e41f4b71Sopenharmony_ci| 401  | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;2. Incorrect parameter types; 3. Parameter verification failed. |
168e41f4b71Sopenharmony_ci
169e41f4b71Sopenharmony_ci**Example**
170e41f4b71Sopenharmony_ci
171e41f4b71Sopenharmony_ci```js
172e41f4b71Sopenharmony_citry {
173e41f4b71Sopenharmony_ci  inputDevice.getKeyboardRepeatDelay().then((delay: Number) => {
174e41f4b71Sopenharmony_ci    console.log(`Get keyboard repeat delay success`);
175e41f4b71Sopenharmony_ci  });
176e41f4b71Sopenharmony_ci} catch (error) {
177e41f4b71Sopenharmony_ci  console.log(`Get keyboard repeat delay failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
178e41f4b71Sopenharmony_ci}
179e41f4b71Sopenharmony_ci```
180e41f4b71Sopenharmony_ci
181e41f4b71Sopenharmony_ci## inputDevice.setKeyboardRepeatRate<sup>10+</sup>
182e41f4b71Sopenharmony_ci
183e41f4b71Sopenharmony_cisetKeyboardRepeatRate(rate: number, callback: AsyncCallback&lt;void&gt;): void
184e41f4b71Sopenharmony_ci
185e41f4b71Sopenharmony_ciSets the keyboard repeat rate. This API uses an asynchronous callback to return the result.
186e41f4b71Sopenharmony_ci
187e41f4b71Sopenharmony_ci**System capability**: SystemCapability.MultimodalInput.Input.InputDevice
188e41f4b71Sopenharmony_ci
189e41f4b71Sopenharmony_ci**System API**: This is a system API.
190e41f4b71Sopenharmony_ci
191e41f4b71Sopenharmony_ci**Parameters**
192e41f4b71Sopenharmony_ci
193e41f4b71Sopenharmony_ci| Name    | Type  | Mandatory| Description                                                        |
194e41f4b71Sopenharmony_ci| -------- | ------ | ---- | ------------------------------------------------------------ |
195e41f4b71Sopenharmony_ci| rate    | number                    | Yes   | Keyboard repeat rate, in ms/time. The value range is [36, 100] and the default value is 50.|
196e41f4b71Sopenharmony_ci| callback | AsyncCallback&lt;void&gt; | Yes   | Callback used to return the result.|
197e41f4b71Sopenharmony_ci
198e41f4b71Sopenharmony_ci**Error codes**
199e41f4b71Sopenharmony_ci
200e41f4b71Sopenharmony_ciFor details about the error codes, see [Universal Error Codes](../errorcode-universal.md).
201e41f4b71Sopenharmony_ci
202e41f4b71Sopenharmony_ci| ID | Error Message            |
203e41f4b71Sopenharmony_ci| ---- | --------------------- |
204e41f4b71Sopenharmony_ci| 202  | SystemAPI permission error |
205e41f4b71Sopenharmony_ci| 401  | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;2. Incorrect parameter types; 3. Parameter verification failed. |
206e41f4b71Sopenharmony_ci
207e41f4b71Sopenharmony_ci**Example**
208e41f4b71Sopenharmony_ci
209e41f4b71Sopenharmony_ci```js
210e41f4b71Sopenharmony_citry {
211e41f4b71Sopenharmony_ci  inputDevice.setKeyboardRepeatRate(60, (error: Error) => {
212e41f4b71Sopenharmony_ci    if (error) {
213e41f4b71Sopenharmony_ci      console.log(`Set keyboard repeat rate failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
214e41f4b71Sopenharmony_ci      return;
215e41f4b71Sopenharmony_ci    }
216e41f4b71Sopenharmony_ci    console.log(`Set keyboard repeat rate success`);
217e41f4b71Sopenharmony_ci  });
218e41f4b71Sopenharmony_ci} catch (error) {
219e41f4b71Sopenharmony_ci  console.log(`Set keyboard repeat rate failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
220e41f4b71Sopenharmony_ci}
221e41f4b71Sopenharmony_ci```
222e41f4b71Sopenharmony_ci
223e41f4b71Sopenharmony_ci## inputDevice.setKeyboardRepeatRate<sup>10+</sup>
224e41f4b71Sopenharmony_ci
225e41f4b71Sopenharmony_cisetKeyboardRepeatRate(rate: number): Promise&lt;void&gt;
226e41f4b71Sopenharmony_ci
227e41f4b71Sopenharmony_ciSets the keyboard repeat rate. This API uses a promise to return the result.
228e41f4b71Sopenharmony_ci
229e41f4b71Sopenharmony_ci**System capability**: SystemCapability.MultimodalInput.Input.InputDevice
230e41f4b71Sopenharmony_ci
231e41f4b71Sopenharmony_ci**System API**: This is a system API.
232e41f4b71Sopenharmony_ci
233e41f4b71Sopenharmony_ci**Parameters**
234e41f4b71Sopenharmony_ci
235e41f4b71Sopenharmony_ci| Name   | Type    | Mandatory  | Description                                 |
236e41f4b71Sopenharmony_ci| ----- | ------ | ---- | ----------------------------------- |
237e41f4b71Sopenharmony_ci| rate | number | Yes   | Keyboard repeat rate, in ms/time. The value range is [36, 100] and the default value is 50.|
238e41f4b71Sopenharmony_ci
239e41f4b71Sopenharmony_ci**Return value**
240e41f4b71Sopenharmony_ci
241e41f4b71Sopenharmony_ci| Parameters                 | Description              |
242e41f4b71Sopenharmony_ci| ------------------- | ---------------- |
243e41f4b71Sopenharmony_ci| Promise&lt;void&gt; | Promise used to return the result.|
244e41f4b71Sopenharmony_ci
245e41f4b71Sopenharmony_ci**Error codes**
246e41f4b71Sopenharmony_ci
247e41f4b71Sopenharmony_ciFor details about the error codes, see [Universal Error Codes](../errorcode-universal.md).
248e41f4b71Sopenharmony_ci
249e41f4b71Sopenharmony_ci| ID | Error Message            |
250e41f4b71Sopenharmony_ci| ---- | --------------------- |
251e41f4b71Sopenharmony_ci| 202  | SystemAPI permission error |
252e41f4b71Sopenharmony_ci| 401  | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;2. Incorrect parameter types; 3. Parameter verification failed. |
253e41f4b71Sopenharmony_ci
254e41f4b71Sopenharmony_ci**Example**
255e41f4b71Sopenharmony_ci
256e41f4b71Sopenharmony_ci```js
257e41f4b71Sopenharmony_citry {
258e41f4b71Sopenharmony_ci  inputDevice.setKeyboardRepeatRate(60).then(() => {
259e41f4b71Sopenharmony_ci    console.log(`Set keyboard repeat rate success`);
260e41f4b71Sopenharmony_ci  });
261e41f4b71Sopenharmony_ci} catch (error) {
262e41f4b71Sopenharmony_ci  console.log(`Set keyboard repeat rate failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
263e41f4b71Sopenharmony_ci}
264e41f4b71Sopenharmony_ci```
265e41f4b71Sopenharmony_ci
266e41f4b71Sopenharmony_ci## inputDevice.getKeyboardRepeatRate<sup>10+</sup>
267e41f4b71Sopenharmony_ci
268e41f4b71Sopenharmony_cigetKeyboardRepeatRate(callback: AsyncCallback&lt;number&gt;): void
269e41f4b71Sopenharmony_ci
270e41f4b71Sopenharmony_ciObtains the keyboard repeat rate. This API uses an asynchronous callback to return the result.
271e41f4b71Sopenharmony_ci
272e41f4b71Sopenharmony_ci**System capability**: SystemCapability.MultimodalInput.Input.InputDevice
273e41f4b71Sopenharmony_ci
274e41f4b71Sopenharmony_ci**System API**: This is a system API.
275e41f4b71Sopenharmony_ci
276e41f4b71Sopenharmony_ci**Parameters**
277e41f4b71Sopenharmony_ci
278e41f4b71Sopenharmony_ci| Name      | Type                         | Mandatory  | Description            |
279e41f4b71Sopenharmony_ci| -------- | --------------------------- | ---- | -------------- |
280e41f4b71Sopenharmony_ci| callback | AsyncCallback&lt;number&gt; | Yes   | Callback used to return the result.|
281e41f4b71Sopenharmony_ci
282e41f4b71Sopenharmony_ci**Error codes**
283e41f4b71Sopenharmony_ci
284e41f4b71Sopenharmony_ciFor details about the error codes, see [Universal Error Codes](../errorcode-universal.md).
285e41f4b71Sopenharmony_ci
286e41f4b71Sopenharmony_ci| ID | Error Message            |
287e41f4b71Sopenharmony_ci| ---- | --------------------- |
288e41f4b71Sopenharmony_ci| 202  | SystemAPI permission error |
289e41f4b71Sopenharmony_ci| 401  | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;2. Incorrect parameter types; 3. Parameter verification failed. |
290e41f4b71Sopenharmony_ci
291e41f4b71Sopenharmony_ci**Example**
292e41f4b71Sopenharmony_ci
293e41f4b71Sopenharmony_ci```js
294e41f4b71Sopenharmony_citry {
295e41f4b71Sopenharmony_ci  inputDevice.getKeyboardRepeatRate((error: Error, rate: Number) => {
296e41f4b71Sopenharmony_ci    if (error) {
297e41f4b71Sopenharmony_ci      console.log(`Get keyboard repeat rate failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
298e41f4b71Sopenharmony_ci      return;
299e41f4b71Sopenharmony_ci    }
300e41f4b71Sopenharmony_ci    console.log(`Get keyboard repeat rate success`);
301e41f4b71Sopenharmony_ci  });
302e41f4b71Sopenharmony_ci} catch (error) {
303e41f4b71Sopenharmony_ci  console.log(`Get keyboard repeat rate failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
304e41f4b71Sopenharmony_ci}
305e41f4b71Sopenharmony_ci```
306e41f4b71Sopenharmony_ci
307e41f4b71Sopenharmony_ci## inputDevice.getKeyboardRepeatRate<sup>10+</sup>
308e41f4b71Sopenharmony_ci
309e41f4b71Sopenharmony_cigetKeyboardRepeatRate(): Promise&lt;number&gt;
310e41f4b71Sopenharmony_ci
311e41f4b71Sopenharmony_ciObtains the keyboard repeat rate. This API uses a promise to return the result.
312e41f4b71Sopenharmony_ci
313e41f4b71Sopenharmony_ci**System capability**: SystemCapability.MultimodalInput.Input.InputDevice
314e41f4b71Sopenharmony_ci
315e41f4b71Sopenharmony_ci**System API**: This is a system API.
316e41f4b71Sopenharmony_ci
317e41f4b71Sopenharmony_ci**Return value**
318e41f4b71Sopenharmony_ci
319e41f4b71Sopenharmony_ci| Parameters                   | Description                 |
320e41f4b71Sopenharmony_ci| --------------------- | ------------------- |
321e41f4b71Sopenharmony_ci| Promise&lt;number&gt; | Promise used to return the result.|
322e41f4b71Sopenharmony_ci
323e41f4b71Sopenharmony_ci**Error codes**
324e41f4b71Sopenharmony_ci
325e41f4b71Sopenharmony_ciFor details about the error codes, see [Universal Error Codes](../errorcode-universal.md).
326e41f4b71Sopenharmony_ci
327e41f4b71Sopenharmony_ci| ID | Error Message            |
328e41f4b71Sopenharmony_ci| ---- | --------------------- |
329e41f4b71Sopenharmony_ci| 202  | SystemAPI permission error |
330e41f4b71Sopenharmony_ci| 401  | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;2. Incorrect parameter types; 3. Parameter verification failed. |
331e41f4b71Sopenharmony_ci
332e41f4b71Sopenharmony_ci**Example**
333e41f4b71Sopenharmony_ci
334e41f4b71Sopenharmony_ci```js
335e41f4b71Sopenharmony_citry {
336e41f4b71Sopenharmony_ci  inputDevice.getKeyboardRepeatRate().then((rate: Number) => {
337e41f4b71Sopenharmony_ci    console.log(`Get keyboard repeat rate success`);
338e41f4b71Sopenharmony_ci  });
339e41f4b71Sopenharmony_ci} catch (error) {
340e41f4b71Sopenharmony_ci  console.log(`Get keyboard repeat rate failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
341e41f4b71Sopenharmony_ci}
342e41f4b71Sopenharmony_ci```
343