1c29fa5a6Sopenharmony_ci/*
2c29fa5a6Sopenharmony_ci * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
3c29fa5a6Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4c29fa5a6Sopenharmony_ci * you may not use this file except in compliance with the License.
5c29fa5a6Sopenharmony_ci * You may obtain a copy of the License at
6c29fa5a6Sopenharmony_ci *
7c29fa5a6Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0
8c29fa5a6Sopenharmony_ci *
9c29fa5a6Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10c29fa5a6Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11c29fa5a6Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12c29fa5a6Sopenharmony_ci * See the License for the specific language governing permissions and
13c29fa5a6Sopenharmony_ci * limitations under the License.
14c29fa5a6Sopenharmony_ci */
15c29fa5a6Sopenharmony_ci
16c29fa5a6Sopenharmony_ci#include "virtual_keyboard_consumer_ctrl.h"
17c29fa5a6Sopenharmony_ci
18c29fa5a6Sopenharmony_cinamespace OHOS {
19c29fa5a6Sopenharmony_cinamespace MMI {
20c29fa5a6Sopenharmony_cinamespace {
21c29fa5a6Sopenharmony_ciconstexpr int32_t ABS_MAX_VOLUME = 572;
22c29fa5a6Sopenharmony_ci
23c29fa5a6Sopenharmony_ciAbsInfo absInfos[] = {
24c29fa5a6Sopenharmony_ci    {ABS_VOLUME, 0, ABS_MAX_VOLUME, 0, 0}
25c29fa5a6Sopenharmony_ci};
26c29fa5a6Sopenharmony_ci} // namespace
27c29fa5a6Sopenharmony_ci
28c29fa5a6Sopenharmony_ciVirtualKeyboardConsumerCtrl::VirtualKeyboardConsumerCtrl()
29c29fa5a6Sopenharmony_ci    : VirtualDevice("Virtual KeyboardConsumerCtrl", BUS_USB, 0x24ae, 0x4035)
30c29fa5a6Sopenharmony_ci{
31c29fa5a6Sopenharmony_ci    eventTypes_ = { EV_KEY, EV_REL, EV_ABS, EV_MSC };
32c29fa5a6Sopenharmony_ci    abs_ = { ABS_VOLUME };
33c29fa5a6Sopenharmony_ci    keys_ = {
34c29fa5a6Sopenharmony_ci        1, 28, 74, 78, 103, 105, 106, 108, 113, 114, 115, 116, 119, 128, 130, 131, 133, 134, 135, 136, 137, 138, 139,
35c29fa5a6Sopenharmony_ci        140, 142, 144, 150, 152, 155, 156, 158, 159, 161, 163, 164, 165, 166, 167, 168, 169, 171, 172, 173, 174, 177,
36c29fa5a6Sopenharmony_ci        178, 181, 206, 207, 208, 209, 210, 212, 216, 217, 219, 224, 225, 228, 229, 230, 234, 235, 240, 241, 244, 256,
37c29fa5a6Sopenharmony_ci        353, 354, 358, 362, 366, 370, 372, 374, 375, 376, 377, 378, 379, 380, 381, 383, 384, 386, 387, 389, 392, 393,
38c29fa5a6Sopenharmony_ci        396, 397, 398, 399, 400, 401, 402, 403, 405, 407, 408, 409, 410, 412, 416, 417, 418, 419, 420, 421, 422, 423,
39c29fa5a6Sopenharmony_ci        424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 439, 442, 576, 577, 578, 579, 580, 581, 582, 583, 592, 593
40c29fa5a6Sopenharmony_ci    };
41c29fa5a6Sopenharmony_ci    relBits_ = { REL_HWHEEL, REL_HWHEEL_HI_RES };
42c29fa5a6Sopenharmony_ci    miscellaneous_ = { MSC_SCAN };
43c29fa5a6Sopenharmony_ci
44c29fa5a6Sopenharmony_ci    for (const auto &item : absInfos) {
45c29fa5a6Sopenharmony_ci        SetAbsValue(item);
46c29fa5a6Sopenharmony_ci    }
47c29fa5a6Sopenharmony_ci}
48c29fa5a6Sopenharmony_ci} // namespace MMI
49c29fa5a6Sopenharmony_ci} // namespace OHOS