1/* 2 * Copyright (c) 2022 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 * @addtogroup HdiInput 18 * @{ 19 * 20 * @brief Provides APIs for the upper-layer input service. 21 * 22 * Using the APIs provided by the Input module, input service developers can implement the following 23 * functions: enabling or disabling input devices, obtaining input events, querying device information, 24 * registering callback functions, and managing the feature status. 25 * 26 * @since 3.2 27 * @version 1.0 28 */ 29 30/** 31 * @file IInputCallback.idl 32 * 33 * @brief Provides data reporting and hot swap event reporting callbacks for the input service. 34 * 35 * @since 3.2 36 * @version 1.0 37 */ 38 39/** 40 * @brief Defines the package path of the Input module APIs. 41 * 42 * @since 3.2 43 * @version 1.0 44 */ 45package ohos.hdi.input.v1_0; 46 47import ohos.hdi.input.v1_0.InputTypes; 48 49/** 50 * @brief Defines the callbacks of the Input module. 51 * 52 * When an input device performs operations such as data reporting, insertion, or removal, the input service 53 * can call the respective callback for data processing. 54 * 55 * @since 3.2 56 * @version 1.0 57 */ 58[callback] interface IInputCallback { 59 /** 60 * @brief Called to report input event data. 61 * 62 * @param pkgs Input event data reported by the driver. For details, see {@link EventPackage}. 63 * @param devIndex Index of the input device. The value ranges from <b>0</b> to <b>31</b>. 64 * A maximum of 32 input devices are supported. 65 * 66 * @since 3.2 67 * @version 1.0 68 */ 69 EventPkgCallback([in] struct EventPackage[] pkgs, [in] unsigned int devIndex); 70 71 /** 72 * @brief Called to report hot plug events. 73 * 74 * @param event Hot swap event data. For details, see {@link HotPlugEvent}. 75 * 76 * @since 3.2 77 * @version 1.0 78 */ 79 HotPlugCallback([in] struct HotPlugEvent event); 80} 81/** @} */ 82