• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2* Copyright (c) 2023 Huawei Device Co., Ltd.
3* Licensed under the Apache License, Version 2.0 (the "License");
4* you may not use this file except in compliance with the License.
5* You may obtain a copy of the License at
6*
7* http://www.apache.org/licenses/LICENSE-2.0
8*
9* Unless required by applicable law or agreed to in writing, software
10* distributed under the License is distributed on an "AS IS" BASIS,
11* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12* See the License for the specific language governing permissions and
13* limitations under the License.
14*/
15
16/**
17 * @file
18 * @kit InputKit
19 */
20
21import type { AsyncCallback } from './@ohos.base';
22/**
23 * Declares interfaces related to short key attributes.
24 *
25 * @namespace shortKey
26 * @syscap SystemCapability.MultimodalInput.Input.ShortKey
27 * @systemapi hide for inner use
28 * @since 10
29 */
30
31declare namespace shortKey {
32  /**
33   * Sets short key down duration.
34   * @param { string } businessKey - The key for business which should be applied to MMI.
35   * @param { number } delay - Duration of short key press which should be limited to 0-4000ms.
36   * @param { AsyncCallback<void> } callback - Callback used to return the result.
37   * @throws { BusinessError } 202 - SystemAPI permission error.
38   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
39   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
40   * @syscap SystemCapability.MultimodalInput.Input.ShortKey
41   * @systemapi hide for inner use
42   * @since 10
43   */
44  function setKeyDownDuration(businessKey: string, delay: number, callback: AsyncCallback<void>): void;
45
46  /**
47   * Sets short key down duration.
48   * @param { string } businessKey - The key for business which should be applied to MMI.
49   * @param { number } delay - Duration of short key press which should be limited to 0-4000ms.
50   * @returns { Promise<void> } Returns the result through a promise.
51   * @throws { BusinessError } 202 - SystemAPI permission error.
52   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
53   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
54   * @syscap SystemCapability.MultimodalInput.Input.ShortKey
55   * @systemapi hide for inner use
56   * @since 10
57   */
58  function setKeyDownDuration(businessKey: string, delay: number): Promise<void>;
59
60}
61export default shortKey;
62
63/**
64 * Enumerates fingerprint key event types.
65 *
66 * @enum { number }
67 * @syscap SystemCapability.MultimodalInput.Input.Core
68 * @systemapi Hide this for inner system use.
69 * @since 12
70 */
71export declare enum FingerprintAction {
72  /**
73   * Key touching.
74   *
75   * @syscap SystemCapability.MultimodalInput.Input.Core
76   * @systemapi Hide this for inner system use.
77   * @since 12
78   */
79  DOWN = 0,
80
81  /**
82   * Finger lifting.
83   *
84   * @syscap SystemCapability.MultimodalInput.Input.Core
85   * @systemapi Hide this for inner system use.
86   * @since 12
87   */
88  UP = 1,
89
90  /**
91   * Sliding on the fingerprint key.
92   *
93   * @syscap SystemCapability.MultimodalInput.Input.Core
94   * @systemapi Hide this for inner system use.
95   * @since 12
96   */
97  SLIDE = 2,
98
99  /**
100   *  Second touch during the double-click process.
101   *
102   * @syscap SystemCapability.MultimodalInput.Input.Core
103   * @systemapi Hide this for inner system use.
104   * @since 12
105   */
106  RETOUCH = 3,
107
108  /**
109   * Double-click event.
110   *
111   * @syscap SystemCapability.MultimodalInput.Input.Core
112   * @systemapi Hide this for inner system use.
113   * @since 12
114   */
115  CLICK = 4,
116}
117
118/**
119 * Fingerprint key event.
120 *
121 * @interface FingerprintEvent
122 * @syscap SystemCapability.MultimodalInput.Input.Core
123 * @systemapi Hide this for inner system use.
124 * @since 12
125 */
126export declare interface FingerprintEvent {
127  /**
128   * Fingerprint key event type.
129   *
130   * @type { FingerprintAction }
131   * @syscap SystemCapability.MultimodalInput.Input.Core
132   * @systemapi Hide this for inner system use.
133   * @since 12
134   */
135  action: FingerprintAction;
136
137  /**
138   * This value indicates the sliding percentage of the fingerprint key on the X axis,
139   * that is, the ratio of the relative sliding distance to the device length
140   * compared with the previous report of the sliding event.
141   * A positive value indicates moving in the positive direction of the X axis,
142   * and a negative value indicates the opposite.
143   * The vertical upward direction of the device stands for the positive direction of the Y axis,
144   * and the horizontal rightward direction stands for the positive direction of the X axis.
145   * This way, a rectangular coordinate system is constructed.
146   *
147   * @type { number }
148   * @syscap SystemCapability.MultimodalInput.Input.Core
149   * @systemapi Hide this for inner system use.
150   * @since 12
151   */
152  distanceX: number;
153
154  /**
155   * This value indicates the sliding percentage of the fingerprint key on the Y axis,
156   * that is, the ratio of the relative sliding distance to the component length
157   * compared with the previous report of the sliding event.
158   * A positive value indicates moving in the positive direction of the Y axis,
159   * and a negative value indicates the opposite.
160   * The vertical upward direction of the device stands for the positive direction of the Y axis,
161   * and the horizontal rightward direction stands for the positive direction of the X axis.
162   * This way, a rectangular coordinate system is constructed.
163   *
164   * @type { number }
165   * @syscap SystemCapability.MultimodalInput.Input.Core
166   * @systemapi Hide this for inner system use.
167   * @since 12
168   */
169  distanceY: number;
170}