1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
// automatically generated by rust-bindgen 0.71.1
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
use crate::axis_type::{InputEvent_AxisAction, InputEvent_AxisEventType, InputEvent_AxisType};
#[cfg(feature = "api-14")]
use ohos_sys_opaque_types::Input_Hotkey;
use ohos_sys_opaque_types::{
Input_AxisEvent, Input_KeyEvent, Input_KeyState, Input_MouseEvent, Input_TouchEvent,
};
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl Input_KeyStateAction {
/// Default
pub const KEY_DEFAULT: Input_KeyStateAction = Input_KeyStateAction(-1);
/// Pressing of a key
pub const KEY_PRESSED: Input_KeyStateAction = Input_KeyStateAction(0);
/// Release of a key
pub const KEY_RELEASED: Input_KeyStateAction = Input_KeyStateAction(1);
/// Key switch enabled
pub const KEY_SWITCH_ON: Input_KeyStateAction = Input_KeyStateAction(2);
/// Key switch disabled
pub const KEY_SWITCH_OFF: Input_KeyStateAction = Input_KeyStateAction(3);
}
#[repr(transparent)]
/// Enumerated values of key event action.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Input_KeyStateAction(pub ::core::ffi::c_int);
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl Input_KeyEventAction {
/// Cancellation of a key action.
pub const KEY_ACTION_CANCEL: Input_KeyEventAction = Input_KeyEventAction(0);
/// Pressing of a key.
pub const KEY_ACTION_DOWN: Input_KeyEventAction = Input_KeyEventAction(1);
/// Release of a key.
pub const KEY_ACTION_UP: Input_KeyEventAction = Input_KeyEventAction(2);
}
#[repr(transparent)]
/// Enumerates key event types.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Input_KeyEventAction(pub ::core::ffi::c_uint);
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl Input_MouseEventAction {
/// Cancel.
pub const MOUSE_ACTION_CANCEL: Input_MouseEventAction = Input_MouseEventAction(0);
/// Moving of the mouse pointer.
pub const MOUSE_ACTION_MOVE: Input_MouseEventAction = Input_MouseEventAction(1);
/// Pressing down of the mouse.
pub const MOUSE_ACTION_BUTTON_DOWN: Input_MouseEventAction = Input_MouseEventAction(2);
/// Lifting of the mouse button.
pub const MOUSE_ACTION_BUTTON_UP: Input_MouseEventAction = Input_MouseEventAction(3);
/// Beginning of the mouse axis event
pub const MOUSE_ACTION_AXIS_BEGIN: Input_MouseEventAction = Input_MouseEventAction(4);
/// Updating of the mouse axis event
pub const MOUSE_ACTION_AXIS_UPDATE: Input_MouseEventAction = Input_MouseEventAction(5);
/// End of the mouse axis event
pub const MOUSE_ACTION_AXIS_END: Input_MouseEventAction = Input_MouseEventAction(6);
}
#[repr(transparent)]
/// Enumerated values of mouse event action.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Input_MouseEventAction(pub ::core::ffi::c_uint);
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl InputEvent_MouseAxis {
/// Vertical scroll axis
pub const MOUSE_AXIS_SCROLL_VERTICAL: InputEvent_MouseAxis = InputEvent_MouseAxis(0);
/// Horizontal scroll axis
pub const MOUSE_AXIS_SCROLL_HORIZONTAL: InputEvent_MouseAxis = InputEvent_MouseAxis(1);
}
#[repr(transparent)]
/// Mouse axis types.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct InputEvent_MouseAxis(pub ::core::ffi::c_uint);
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl Input_MouseEventButton {
/// Invalid button
pub const MOUSE_BUTTON_NONE: Input_MouseEventButton = Input_MouseEventButton(-1);
/// Left button on the mouse.
pub const MOUSE_BUTTON_LEFT: Input_MouseEventButton = Input_MouseEventButton(0);
/// Middle button on the mouse.
pub const MOUSE_BUTTON_MIDDLE: Input_MouseEventButton = Input_MouseEventButton(1);
/// Right button on the mouse.
pub const MOUSE_BUTTON_RIGHT: Input_MouseEventButton = Input_MouseEventButton(2);
/// Forward button on the mouse.
pub const MOUSE_BUTTON_FORWARD: Input_MouseEventButton = Input_MouseEventButton(3);
/// Back button on the mouse.
pub const MOUSE_BUTTON_BACK: Input_MouseEventButton = Input_MouseEventButton(4);
}
#[repr(transparent)]
/// Enumerated values of mouse event button.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Input_MouseEventButton(pub ::core::ffi::c_int);
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl Input_TouchEventAction {
/// Touch cancelled.
pub const TOUCH_ACTION_CANCEL: Input_TouchEventAction = Input_TouchEventAction(0);
/// Touch pressed.
pub const TOUCH_ACTION_DOWN: Input_TouchEventAction = Input_TouchEventAction(1);
/// Touch moved.
pub const TOUCH_ACTION_MOVE: Input_TouchEventAction = Input_TouchEventAction(2);
/// Touch lifted.
pub const TOUCH_ACTION_UP: Input_TouchEventAction = Input_TouchEventAction(3);
}
#[repr(transparent)]
/// Enumerated values of touch event action.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Input_TouchEventAction(pub ::core::ffi::c_uint);
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
impl Input_KeyboardType {
/// Keyboard without keys
pub const KEYBOARD_TYPE_NONE: Input_KeyboardType = Input_KeyboardType(0);
/// Keyboard with unknown keys
pub const KEYBOARD_TYPE_UNKNOWN: Input_KeyboardType = Input_KeyboardType(1);
/// Full keyboard
pub const KEYBOARD_TYPE_ALPHABETIC: Input_KeyboardType = Input_KeyboardType(2);
/// Digital keyboard
pub const KEYBOARD_TYPE_DIGITAL: Input_KeyboardType = Input_KeyboardType(3);
/// Stylus
pub const KEYBOARD_TYPE_STYLUS: Input_KeyboardType = Input_KeyboardType(4);
/// Remote control
pub const KEYBOARD_TYPE_REMOTE_CONTROL: Input_KeyboardType = Input_KeyboardType(5);
}
#[repr(transparent)]
/// Enumerates keyboard types.
///
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Input_KeyboardType(pub ::core::ffi::c_uint);
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
impl Input_InjectionStatus {
/// Unauthorized
pub const UNAUTHORIZED: Input_InjectionStatus = Input_InjectionStatus(0);
/// Authorizing
pub const AUTHORIZING: Input_InjectionStatus = Input_InjectionStatus(1);
/// Authorized
pub const AUTHORIZED: Input_InjectionStatus = Input_InjectionStatus(2);
}
#[repr(transparent)]
/// Enumerates the injection authorization status.
///
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Input_InjectionStatus(pub ::core::ffi::c_uint);
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl InputEvent_SourceType {
/// Indicates that the input source generates events similar to mouse cursor movement,
/// button press and release, and wheel scrolling.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub const SOURCE_TYPE_MOUSE: InputEvent_SourceType = InputEvent_SourceType(1);
/// Indicates that the input source generates a touchscreen multi-touch event.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub const SOURCE_TYPE_TOUCHSCREEN: InputEvent_SourceType = InputEvent_SourceType(2);
/// Indicates that the input source generates a touchpad multi-touch event.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub const SOURCE_TYPE_TOUCHPAD: InputEvent_SourceType = InputEvent_SourceType(3);
}
#[repr(transparent)]
/// Enumerates event source types.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct InputEvent_SourceType(pub ::core::ffi::c_uint);
pub type Input_Result = Result<(), InputErrorCode>;
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl InputErrorCode {
/// Permission verification failed
pub const PERMISSION_DENIED: InputErrorCode =
InputErrorCode(const { core::num::NonZero::new(201).unwrap() });
/// Non-system application
pub const NOT_SYSTEM_APPLICATION: InputErrorCode =
InputErrorCode(const { core::num::NonZero::new(202).unwrap() });
/// Parameter check failed
pub const PARAMETER_ERROR: InputErrorCode =
InputErrorCode(const { core::num::NonZero::new(401).unwrap() });
/// Device not support
pub const DEVICE_NOT_SUPPORTED: InputErrorCode =
InputErrorCode(const { core::num::NonZero::new(801).unwrap() });
/// Service error
pub const SERVICE_EXCEPTION: InputErrorCode =
InputErrorCode(const { core::num::NonZero::new(3800001).unwrap() });
/// Interceptor repeatedly created for an application
pub const REPEAT_INTERCEPTOR: InputErrorCode =
InputErrorCode(const { core::num::NonZero::new(4200001).unwrap() });
/// Already occupied by the system
///
/// Available since API-level: 14
#[cfg(feature = "api-14")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
pub const OCCUPIED_BY_SYSTEM: InputErrorCode =
InputErrorCode(const { core::num::NonZero::new(4200002).unwrap() });
/// Already occupied by the other
///
/// Available since API-level: 14
#[cfg(feature = "api-14")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
pub const OCCUPIED_BY_OTHER: InputErrorCode =
InputErrorCode(const { core::num::NonZero::new(4200003).unwrap() });
/// No keyboard device connected
///
/// Available since API-level: 15
#[cfg(feature = "api-15")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
pub const KEYBOARD_DEVICE_NOT_EXIST: InputErrorCode =
InputErrorCode(const { core::num::NonZero::new(3900002).unwrap() });
/// Authorizing
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub const INJECTION_AUTHORIZING: InputErrorCode =
InputErrorCode(const { core::num::NonZero::new(3900005).unwrap() });
/// Too many operations
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub const INJECTION_OPERATION_FREQUENT: InputErrorCode =
InputErrorCode(const { core::num::NonZero::new(3900006).unwrap() });
/// Authorized
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub const INJECTION_AUTHORIZED: InputErrorCode =
InputErrorCode(const { core::num::NonZero::new(3900007).unwrap() });
/// Authorized to other applications
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub const INJECTION_AUTHORIZED_OTHERS: InputErrorCode =
InputErrorCode(const { core::num::NonZero::new(3900008).unwrap() });
/// App is not the focused app
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub const APP_NOT_FOCUSED: InputErrorCode =
InputErrorCode(const { core::num::NonZero::new(3900009).unwrap() });
/// The device has no pointer
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub const DEVICE_NO_POINTER: InputErrorCode =
InputErrorCode(const { core::num::NonZero::new(3900010).unwrap() });
}
#[repr(transparent)]
/// Enumerates error codes.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct InputErrorCode(pub core::num::NonZero<::core::ffi::c_uint>);
/// Callback used to return shortcut key events.
///
/// Available since API-level: 14
#[cfg(feature = "api-14")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
pub type Input_HotkeyCallback =
::core::option::Option<unsafe extern "C" fn(hotkey: *mut Input_Hotkey)>;
/// Represents information about the input device.
///
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
#[repr(C)]
pub struct Input_DeviceInfo {
_unused: [u8; 0],
}
/// Defines a lifecycle callback for keyEvent. If the callback is triggered, keyEvent will be destroyed.
///
/// # Arguments
///
/// * `keyEvent` - Key event object.
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub type Input_KeyEventCallback =
::core::option::Option<unsafe extern "C" fn(keyEvent: *const Input_KeyEvent)>;
/// Defines a lifecycle callback for mouseEvent. If the callback is triggered, mouseEvent will be destroyed.
///
/// # Arguments
///
/// * `mouseEvent` - Mouse event object.
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub type Input_MouseEventCallback =
::core::option::Option<unsafe extern "C" fn(mouseEvent: *const Input_MouseEvent)>;
/// Defines a lifecycle callback for touchEvent. If the callback is triggered, touchEvent will be destroyed.
///
/// # Arguments
///
/// * `touchEvent` - Touch event object.
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub type Input_TouchEventCallback =
::core::option::Option<unsafe extern "C" fn(touchEvent: *const Input_TouchEvent)>;
/// Defines a lifecycle callback for axisEvent. If the callback is triggered, axisEvent will be destroyed.
///
/// # Arguments
///
/// * `axisEvent` - Axis event object.
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub type Input_AxisEventCallback =
::core::option::Option<unsafe extern "C" fn(axisEvent: *const Input_AxisEvent)>;
/// Defines the callback for device addition events.
/// # Arguments
///
/// * `deviceId` - Device ID.
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
pub type Input_DeviceAddedCallback = ::core::option::Option<unsafe extern "C" fn(deviceId: i32)>;
/// Defines the callback for device removal events.
/// # Arguments
///
/// * `deviceId` - Device ID.
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
pub type Input_DeviceRemovedCallback = ::core::option::Option<unsafe extern "C" fn(deviceId: i32)>;
/// Defines the event injection callback.
/// # Arguments
///
/// * `authorizedStatus` - Authorization status.
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub type Input_InjectAuthorizeCallback =
::core::option::Option<unsafe extern "C" fn(authorizedStatus: Input_InjectionStatus)>;
/// Defines the structure for the interceptor of event callbacks,
/// including mouseCallback, touchCallback, and axisCallback.
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Input_InterceptorEventCallback {
/// Defines a lifecycle callback for **mouseEvent**.
pub mouseCallback: Input_MouseEventCallback,
/// Defines a lifecycle callback for **touchEvent**.
pub touchCallback: Input_TouchEventCallback,
/// Defines a lifecycle callback for **axisEvent**.
pub axisCallback: Input_AxisEventCallback,
}
/// Defines a listener for device insertion and removal events.
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Input_DeviceListener {
/// Callback for device addition events
pub deviceAddedCallback: Input_DeviceAddedCallback,
/// Callback for device removal events
pub deviceRemovedCallback: Input_DeviceRemovedCallback,
}
/// Defines event interceptor options.
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[repr(C)]
pub struct Input_InterceptorOptions {
_unused: [u8; 0],
}
extern "C" {
/// Queries the key state.
///
/// # Arguments
///
/// * `keyState` - Key state.
///
/// # Returns
///
/// * OH_Input_GetKeyState function result code.
/// [`INPUT_SUCCESS`] get KeyState success.
///
/// [`INPUT_PARAMETER_ERROR`] keyCode is invalid.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_GetKeyState(keyState: *mut Input_KeyState) -> Input_Result;
/// Creates a key status enumeration object.
///
///
/// # Returns
///
/// * Returns an [`Input_KeyState`] pointer object if the operation is successful.
/// Otherwise, a null pointer is returned. The possible cause is memory allocation failure.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_CreateKeyState() -> *mut Input_KeyState;
/// Destroys a key status enumeration object.
///
/// # Arguments
///
/// * `keyState` - Key status enumeration object.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_DestroyKeyState(keyState: *mut *mut Input_KeyState);
/// Sets the key value of a key status enumeration object.
///
/// # Arguments
///
/// * `keyState` - Key status enumeration object.
///
/// * `keyCode` - Key value of the key status enumeration object.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_SetKeyCode(keyState: *mut Input_KeyState, keyCode: i32);
/// Obtains the key value of a key status enumeration object.
///
/// # Arguments
///
/// * `keyState` - Key status enumeration object.
///
/// # Returns
///
/// * Key value of the key status enumeration object.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_GetKeyCode(keyState: *const Input_KeyState) -> i32;
/// Sets whether the key specific to a key status enumeration object is pressed.
///
/// # Arguments
///
/// * `keyState` - Key status enumeration object.
///
/// * `keyAction` - Whether the key is pressed.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_SetKeyPressed(keyState: *mut Input_KeyState, keyAction: i32);
/// Checks whether the key specific to a key status enumeration object is pressed.
///
/// # Arguments
///
/// * `keyState` - Key status enumeration object.
///
/// # Returns
///
/// * Key pressing status of the key status enumeration object.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_GetKeyPressed(keyState: *const Input_KeyState) -> i32;
/// Sets the key switch of the key status enumeration object.
///
/// # Arguments
///
/// * `keyState` - Key status enumeration object.
///
/// * `keySwitch` - Key switch of the key status enumeration object.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_SetKeySwitch(keyState: *mut Input_KeyState, keySwitch: i32);
/// Obtains the key switch of the key status enumeration object.
///
/// # Arguments
///
/// * `keyState` - Key status enumeration object.
///
/// # Returns
///
/// * Key switch of the key status enumeration object.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_GetKeySwitch(keyState: *const Input_KeyState) -> i32;
/// Inject system keys.
/// since API 20, it is recommended to use OH_Input_RequestInjection
/// to request authorization before using the interface,
/// and then use OH_Input_QueryAuthorizedStatus to query the authorization status.
/// When the authorization status is AUTHORIZED, use the interface.
///
/// # Arguments
///
/// * `keyEvent` - - the key event to be injected.
///
/// # Returns
///
/// * OH_Input_InjectKeyEvent function result code.
/// [`INPUT_SUCCESS`] inject keyEvent success.
///
/// [`INPUT_PERMISSION_DENIED`] Permission verification failed.
///
/// [`INPUT_PARAMETER_ERROR`] keyCode is less 0, can not process.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_InjectKeyEvent(keyEvent: *const Input_KeyEvent) -> i32;
/// Creates a key event object.
///
///
/// # Returns
///
/// * Returns an [`Input_KeyEvent`] pointer object if the operation is successful.
/// Otherwise, a null pointer is returned. The possible cause is memory allocation failure.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_CreateKeyEvent() -> *mut Input_KeyEvent;
/// Destroys a key event object.
///
/// # Arguments
///
/// * `keyEvent` - Key event object.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_DestroyKeyEvent(keyEvent: *mut *mut Input_KeyEvent);
/// Sets the key event type.
///
/// # Arguments
///
/// * `keyEvent` - Key event object.
///
/// * `action` - Key event type.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_SetKeyEventAction(keyEvent: *mut Input_KeyEvent, action: i32);
/// Obtains the key event type.
///
/// # Arguments
///
/// * `keyEvent` - Key event object.
///
/// # Returns
///
/// * Key event type.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_GetKeyEventAction(keyEvent: *const Input_KeyEvent) -> i32;
/// Sets the key value for a key event.
///
/// # Arguments
///
/// * `keyEvent` - Key event object.
///
/// * `keyCode` - keyCode Key code.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_SetKeyEventKeyCode(keyEvent: *mut Input_KeyEvent, keyCode: i32);
/// Obtains the key value of a key event.
///
/// # Arguments
///
/// * `keyEvent` - Key event object.
///
/// # Returns
///
/// * Key code.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_GetKeyEventKeyCode(keyEvent: *const Input_KeyEvent) -> i32;
/// Sets the time when a key event occurs.
///
/// # Arguments
///
/// * `keyEvent` - Key event object.
///
/// * `actionTime` - Time when the key event occurs.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_SetKeyEventActionTime(keyEvent: *mut Input_KeyEvent, actionTime: i64);
/// Obtains the time when a key event occurs.
///
/// # Arguments
///
/// * `keyEvent` - Key event object.
///
/// # Returns
///
/// * Returns the time when the key event occurs.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_GetKeyEventActionTime(keyEvent: *const Input_KeyEvent) -> i64;
/// Sets the windowId for a key event.
///
/// # Arguments
///
/// * `keyEvent` - Key event object.
///
/// * `windowId` - The windowId for a key event.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 15
#[cfg(feature = "api-15")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
pub fn OH_Input_SetKeyEventWindowId(keyEvent: *mut Input_KeyEvent, windowId: i32);
/// Obtains the windowId of a key event.
///
/// # Arguments
///
/// * `keyEvent` - Key event object.
///
/// # Returns
///
/// * windowId.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 15
#[cfg(feature = "api-15")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
pub fn OH_Input_GetKeyEventWindowId(keyEvent: *const Input_KeyEvent) -> i32;
/// Sets the displayId for a key event.
///
/// # Arguments
///
/// * `keyEvent` - Key event object.
///
/// * `displayId` - The displayId for a key event.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 15
#[cfg(feature = "api-15")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
pub fn OH_Input_SetKeyEventDisplayId(keyEvent: *mut Input_KeyEvent, displayId: i32);
/// Obtains the displayId of a key event.
///
/// # Arguments
///
/// * `keyEvent` - Key event object.
///
/// # Returns
///
/// * displayId.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 15
#[cfg(feature = "api-15")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
pub fn OH_Input_GetKeyEventDisplayId(keyEvent: *const Input_KeyEvent) -> i32;
/// Get the eventId of the keyEvent.
///
/// # Arguments
///
/// * `keyEvent` - - Key event object.
///
/// * `eventId` - - Get the keyEvent eventId.
///
/// # Returns
///
/// * OH_Input_GetKeyEventId function result code.
/// [`INPUT_SUCCESS`] Get the eventId of the keyEvent success.
///
/// [`INPUT_PARAMETER_ERROR`] Parameter check failed.
///
///
/// Available since API-level: 21
#[cfg(feature = "api-21")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
pub fn OH_Input_GetKeyEventId(
keyEvent: *const Input_KeyEvent,
eventId: *mut i32,
) -> Input_Result;
/// Add a keyEvent interception hook function. Before using this interface,
/// the user needs to authorize it in the settings.
///
/// ohos.permission.HOOK_KEY_EVENT
/// # Arguments
///
/// * `callback` - - Hook function, keyEvent will be sent to the hook function for priority processing.
///
/// # Returns
///
/// * OH_Input_AddKeyEventHook function result code.
/// [`INPUT_SUCCESS`] Added hook function successfully.
///
/// [`INPUT_PARAMETER_ERROR`] Failed to add the hook function. Reason: Parameter check failed.
///
/// [`INPUT_DEVICE_NOT_SUPPORTED`] Capability not supported.
///
/// [`INPUT_PERMISSION_DENIED`] Failed to add the hook function. Reason: Permission check failed.
///
/// [`INPUT_REPEAT_INTERCEPTOR`] Failed to add the hook function.
///
/// Reason: Repeatedly set the hook function. A process can only have one key hook function.
///
/// [`INPUT_SERVICE_EXCEPTION`] Failed to add the hook function.
///
/// Reason: Input service exception, please try again.
///
///
/// Available since API-level: 21
#[cfg(feature = "api-21")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
pub fn OH_Input_AddKeyEventHook(callback: Input_KeyEventCallback) -> Input_Result;
/// Remove keyEvent interception hook function.
///
/// # Arguments
///
/// * `callback` - - Hook function, Same as the parameters when calling OH_Input_AddKeyEventHook.
///
/// # Returns
///
/// * OH_Input_RemoveKeyEventHook function result code.
/// [`INPUT_SUCCESS`] Hook function removed successfully.
///
/// Even if the hook function has not been added before, it will return success when removed.
///
/// [`INPUT_PARAMETER_ERROR`] Failed to remove the hook function. Reason: Parameter check failed.
///
/// [`INPUT_SERVICE_EXCEPTION`] Failed to remove the hook function.
///
/// Reason: Input service exception, please try again.
///
///
/// Available since API-level: 21
#[cfg(feature = "api-21")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
pub fn OH_Input_RemoveKeyEventHook(callback: Input_KeyEventCallback) -> Input_Result;
/// Redispatches keyEvent.
/// Only keyEvent intercepted by hook functions can be redispatched,
/// and the event order must be maintained during redispatching.
/// The hook function intercepts the input event and then redistributes it for 3 seconds.
/// If this time is exceeded, calling this function will return INPUT_PARAMETER_ERROR.
/// Re-dispatching requires event pairing, usually starting with one or more KEY_ACTION_DOWN and
/// ending with KEY_ACTION_UP or KEY_ACTION_CANCEL.
/// Only KEY_ACTION_UP or KEY_ACTION_CANCEL is redispatched, the function call succeeds,
/// but no actual dispatch is made.
/// If an event is dispatched that is not intercepted by the hook function,
/// the function call succeeds, but no actual dispatch action is taken.
///
/// # Arguments
///
/// * `eventId` - - keyEvent eventId.
///
/// # Returns
///
/// * OH_Input_DispatchToNextHandler function result code.
/// [`INPUT_SUCCESS`] Redistribution successful.
///
/// [`INPUT_PARAMETER_ERROR`] Redistribution failed. Reason: KeyEvent does not exist.
///
/// [`INPUT_SERVICE_EXCEPTION`] Redistribution failed.
///
/// Reason: Input service exception, it's recommended to reset the pending distribution status.
///
///
/// Available since API-level: 21
#[cfg(feature = "api-21")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
pub fn OH_Input_DispatchToNextHandler(eventId: i32) -> Input_Result;
/// Inject mouse event.
/// since API 20, it is recommended to use OH_Input_RequestInjection
/// to request authorization before using the interface,
/// and then use OH_Input_QueryAuthorizedStatus to query the authorization status.
/// When the authorization status is AUTHORIZED, use the interface.
///
/// # Arguments
///
/// * `mouseEvent` - - the mouse event to be injected.
///
/// # Returns
///
/// * OH_Input_InjectMouseEvent function result code.
/// [`INPUT_SUCCESS`] inject mouseEvent success.
///
/// [`INPUT_PERMISSION_DENIED`] Permission verification failed.
///
/// [`INPUT_PARAMETER_ERROR`] Parameter check failed.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_InjectMouseEvent(mouseEvent: *const Input_MouseEvent) -> i32;
/// Inject mouse event using global coordinate.
/// since API 20, it is recommended to use OH_Input_RequestInjection
/// to request authorization before using the interface,
/// and then use OH_Input_QueryAuthorizedStatus to query the authorization status.
/// When the authorization status is AUTHORIZED, use the interface.
///
/// # Arguments
///
/// * `mouseEvent` - - the mouse event to be injected, set up effective globalX globalY.
///
/// # Returns
///
/// * OH_Input_InjectMouseEventGlobal function result code.
/// [`INPUT_SUCCESS`] inject mouseEvent success.
///
/// [`INPUT_PERMISSION_DENIED`] Permission verification failed.
///
/// [`INPUT_PARAMETER_ERROR`] Parameter check failed.
///
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub fn OH_Input_InjectMouseEventGlobal(mouseEvent: *const Input_MouseEvent) -> i32;
/// Creates a mouse event object.
///
///
/// # Returns
///
/// * Returns an [`Input_MouseEvent`] pointer object if the operation is successful.
/// Otherwise, a null pointer is returned. The possible cause is memory allocation failure.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_CreateMouseEvent() -> *mut Input_MouseEvent;
/// Destroys a mouse event object.
///
/// # Arguments
///
/// * `mouseEvent` - Mouse event object.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_DestroyMouseEvent(mouseEvent: *mut *mut Input_MouseEvent);
/// Sets the action for a mouse event.
///
/// # Arguments
///
/// * `mouseEvent` - Mouse event object.
///
/// * `action` - Mouse action.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_SetMouseEventAction(mouseEvent: *mut Input_MouseEvent, action: i32);
/// Obtains the action of a mouse event.
///
/// # Arguments
///
/// * `mouseEvent` - Mouse event object.
///
/// # Returns
///
/// * Mouse action.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_GetMouseEventAction(mouseEvent: *const Input_MouseEvent) -> i32;
/// Sets the X coordinate for a mouse event.
///
/// # Arguments
///
/// * `mouseEvent` - Mouse event object.
///
/// * `displayX` - X coordinate on the display.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_SetMouseEventDisplayX(mouseEvent: *mut Input_MouseEvent, displayX: i32);
/// Obtains the X coordinate of a mouse event.
///
/// # Arguments
///
/// * `mouseEvent` - Mouse event object.
///
/// # Returns
///
/// * X coordinate on the display.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_GetMouseEventDisplayX(mouseEvent: *const Input_MouseEvent) -> i32;
/// Sets the Y coordinate for a mouse event.
///
/// # Arguments
///
/// * `mouseEvent` - Mouse event object.
///
/// * `displayY` - Y coordinate on the display.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_SetMouseEventDisplayY(mouseEvent: *mut Input_MouseEvent, displayY: i32);
/// Obtains the Y coordinate of a mouse event.
///
/// # Arguments
///
/// * `mouseEvent` - Mouse event object.
///
/// # Returns
///
/// * Y coordinate on the display.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_GetMouseEventDisplayY(mouseEvent: *const Input_MouseEvent) -> i32;
/// Sets the button for a mouse event.
///
/// # Arguments
///
/// * `mouseEvent` - Mouse event object.
///
/// * `button` - Mouse button.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_SetMouseEventButton(mouseEvent: *mut Input_MouseEvent, button: i32);
/// Obtains the button of a mouse event.
///
/// # Arguments
///
/// * `mouseEvent` - Mouse event object.
///
/// # Returns
///
/// * Mouse button.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_GetMouseEventButton(mouseEvent: *const Input_MouseEvent) -> i32;
/// Sets the axis type for mouse event.
///
/// # Arguments
///
/// * `mouseEvent` - Mouse event object.
///
/// * `axisType` - Axis type, for example, X axis or Y axis.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_SetMouseEventAxisType(mouseEvent: *mut Input_MouseEvent, axisType: i32);
/// Obtains the axis type of a mouse event.
///
/// # Arguments
///
/// * `mouseEvent` - Mouse event object.
///
/// # Returns
///
/// * Axis type.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_GetMouseEventAxisType(mouseEvent: *const Input_MouseEvent) -> i32;
/// Sets the axis value for a mouse axis event.
///
/// # Arguments
///
/// * `mouseEvent` - Mouse event object.
///
/// * `axisValue` - Axis value. A positive value means scrolling forward,
/// and a negative number means scrolling backward.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_SetMouseEventAxisValue(mouseEvent: *mut Input_MouseEvent, axisValue: f32);
/// Obtains the axis value of a mouse event.
///
/// # Arguments
///
/// * `mouseEvent` - Mouse event object.
///
/// # Returns
///
/// * Axis value.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_GetMouseEventAxisValue(mouseEvent: *const Input_MouseEvent) -> f32;
/// Sets the time when a mouse event occurs.
///
/// # Arguments
///
/// * `mouseEvent` - Mouse event object.
///
/// * `actionTime` - Time when the mouse event occurs.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_SetMouseEventActionTime(mouseEvent: *mut Input_MouseEvent, actionTime: i64);
/// Obtains the time when a mouse event occurs.
///
/// # Arguments
///
/// * `mouseEvent` - Mouse event object.
///
/// # Returns
///
/// * Returns the time when the mouse event occurs.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_GetMouseEventActionTime(mouseEvent: *const Input_MouseEvent) -> i64;
/// Sets the windowId for a mouse event.
///
/// # Arguments
///
/// * `mouseEvent` - Mouse event object.
///
/// * `windowId` - The windowId for a mouse event.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 15
#[cfg(feature = "api-15")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
pub fn OH_Input_SetMouseEventWindowId(mouseEvent: *mut Input_MouseEvent, windowId: i32);
/// Obtains the windowId of a mouse event.
///
/// # Arguments
///
/// * `mouseEvent` - Mouse event object.
///
/// # Returns
///
/// * windowId.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 15
#[cfg(feature = "api-15")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
pub fn OH_Input_GetMouseEventWindowId(mouseEvent: *const Input_MouseEvent) -> i32;
/// Sets the displayId for a mouse event.
///
/// # Arguments
///
/// * `mouseEvent` - Mouse event object.
///
/// * `displayId` - The displayId for a mouse event.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 15
#[cfg(feature = "api-15")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
pub fn OH_Input_SetMouseEventDisplayId(mouseEvent: *mut Input_MouseEvent, displayId: i32);
/// Obtains the displayId of a mouse event.
///
/// # Arguments
///
/// * `mouseEvent` - Mouse event object.
///
/// # Returns
///
/// * displayId.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 15
#[cfg(feature = "api-15")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
pub fn OH_Input_GetMouseEventDisplayId(mouseEvent: *const Input_MouseEvent) -> i32;
/// Set the global X coordinate of the mouse event.
///
/// # Arguments
///
/// * `mouseEvent` - Mouse event object.
///
/// * `globalX` - Global X coordinate.
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub fn OH_Input_SetMouseEventGlobalX(mouseEvent: *mut Input_MouseEvent, globalX: i32);
/// Queries the global X coordinate of the mouse event.
///
/// # Arguments
///
/// * `mouseEvent` - Mouse event object.
///
/// # Returns
///
/// * Global X coordinate.
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub fn OH_Input_GetMouseEventGlobalX(mouseEvent: *const Input_MouseEvent) -> i32;
/// Set the global Y coordinate of the mouse event.
///
/// # Arguments
///
/// * `mouseEvent` - Mouse event object.
///
/// * `globalY` - Global Y coordinate.
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub fn OH_Input_SetMouseEventGlobalY(mouseEvent: *mut Input_MouseEvent, globalY: i32);
/// Queries the global Y coordinate of the mouse event.
///
/// # Arguments
///
/// * `mouseEvent` - Mouse event object.
///
/// # Returns
///
/// * Global Y coordinate.
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub fn OH_Input_GetMouseEventGlobalY(mouseEvent: *const Input_MouseEvent) -> i32;
/// Inject touch event.
/// since API 20, it is recommended to use OH_Input_RequestInjection
/// to request authorization before using the interface,
/// and then use OH_Input_QueryAuthorizedStatus to query the authorization status.
/// When the authorization status is AUTHORIZED, use the interface.
///
/// # Arguments
///
/// * `touchEvent` - - the touch event to be injected.
///
/// # Returns
///
/// * OH_Input_InjectTouchEvent function result code.
/// [`INPUT_SUCCESS`] inject touchEvent success.
///
/// [`INPUT_PARAMETER_ERROR`] Parameter check failed.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_InjectTouchEvent(touchEvent: *const Input_TouchEvent) -> i32;
/// Inject touch event using global coordinate.
/// since API 20, it is recommended to use OH_Input_RequestInjection
/// to request authorization before using the interface,
/// and then use OH_Input_QueryAuthorizedStatus to query the authorization status.
/// When the authorization status is AUTHORIZED, use the interface.
///
/// # Arguments
///
/// * `touchEvent` - - the touch event to be injected, set up effective globalX globalY.
///
/// # Returns
///
/// * OH_Input_InjectTouchEventGlobal function result code.
/// [`INPUT_SUCCESS`] inject touchEvent success.
///
/// [`INPUT_PARAMETER_ERROR`] Parameter check failed.
///
/// [`INPUT_PERMISSION_DENIED`] Permission verification failed.
///
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub fn OH_Input_InjectTouchEventGlobal(touchEvent: *const Input_TouchEvent) -> i32;
/// Creates a touch event object.
///
///
/// # Returns
///
/// * Returns an [`Input_TouchEvent`] pointer object if the operation is successful.
/// Otherwise, a null pointer is returned. The possible cause is memory allocation failure.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_CreateTouchEvent() -> *mut Input_TouchEvent;
/// Destroys a touch event object.
///
/// # Arguments
///
/// * `touchEvent` - Touch event object.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_DestroyTouchEvent(touchEvent: *mut *mut Input_TouchEvent);
/// Sets the action for a touch event.
///
/// # Arguments
///
/// * `touchEvent` - Touch event object.
///
/// * `action` - Touch action.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_SetTouchEventAction(touchEvent: *mut Input_TouchEvent, action: i32);
/// Obtains the action of a touch event.
///
/// # Arguments
///
/// * `touchEvent` - Touch event object.
///
/// # Returns
///
/// * Touch action.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_GetTouchEventAction(touchEvent: *const Input_TouchEvent) -> i32;
/// Sets the finger ID for the touch event.
///
/// # Arguments
///
/// * `touchEvent` - Touch event object.
///
/// * `id` - Finger ID.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_SetTouchEventFingerId(touchEvent: *mut Input_TouchEvent, id: i32);
/// Obtains the finger ID of a touch event.
///
/// # Arguments
///
/// * `touchEvent` - Touch event object.
///
/// # Returns
///
/// * Finger ID.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_GetTouchEventFingerId(touchEvent: *const Input_TouchEvent) -> i32;
/// Sets the X coordinate for a touch event.
///
/// # Arguments
///
/// * `touchEvent` - Touch event object.
///
/// * `displayX` - X coordinate.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_SetTouchEventDisplayX(touchEvent: *mut Input_TouchEvent, displayX: i32);
/// Obtains the X coordinate of a touch event.
///
/// # Arguments
///
/// * `touchEvent` - Touch event object.
///
/// # Returns
///
/// * X coordinate.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_GetTouchEventDisplayX(touchEvent: *const Input_TouchEvent) -> i32;
/// Sets the Y coordinate for a touch event.
///
/// # Arguments
///
/// * `touchEvent` - Touch event object.
///
/// * `displayY` - Y coordinate.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_SetTouchEventDisplayY(touchEvent: *mut Input_TouchEvent, displayY: i32);
/// Obtains the Y coordinate of a touch event.
///
/// # Arguments
///
/// * `touchEvent` - Touch event object.
///
/// # Returns
///
/// * Y coordinate.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_GetTouchEventDisplayY(touchEvent: *const Input_TouchEvent) -> i32;
/// Sets the time when a touch event occurs.
///
/// # Arguments
///
/// * `touchEvent` - Touch event object.
///
/// * `actionTime` - Time when the touch event occurs.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_SetTouchEventActionTime(touchEvent: *mut Input_TouchEvent, actionTime: i64);
/// Obtains the time when a touch event occurs.
///
/// # Arguments
///
/// * `touchEvent` - touch event object.
///
/// # Returns
///
/// * Returns the time when the touch event occurs.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_GetTouchEventActionTime(touchEvent: *const Input_TouchEvent) -> i64;
/// Sets the windowId for a touch event.
///
/// # Arguments
///
/// * `touchEvent` - Touch event object.
///
/// * `windowId` - The windowId for a touch event.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 15
#[cfg(feature = "api-15")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
pub fn OH_Input_SetTouchEventWindowId(touchEvent: *mut Input_TouchEvent, windowId: i32);
/// Obtains the windowId of a touch event.
///
/// # Arguments
///
/// * `touchEvent` - Touch event object.
///
/// # Returns
///
/// * windowId.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 15
#[cfg(feature = "api-15")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
pub fn OH_Input_GetTouchEventWindowId(touchEvent: *const Input_TouchEvent) -> i32;
/// Sets the displayId for a touch event.
///
/// # Arguments
///
/// * `touchEvent` - Touch event object.
///
/// * `displayId` - The displayId for a touch event.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 15
#[cfg(feature = "api-15")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
pub fn OH_Input_SetTouchEventDisplayId(touchEvent: *mut Input_TouchEvent, displayId: i32);
/// Obtains the displayId of a touch event.
///
/// # Arguments
///
/// * `touchEvent` - Touch event object.
///
/// # Returns
///
/// * displayId.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 15
#[cfg(feature = "api-15")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
pub fn OH_Input_GetTouchEventDisplayId(touchEvent: *const Input_TouchEvent) -> i32;
/// Set the global X coordinate of the touch event.
///
/// # Arguments
///
/// * `touchEvent` - Touch event object.
///
/// * `globalX` - Global X coordinate.
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub fn OH_Input_SetTouchEventGlobalX(touchEvent: *mut Input_TouchEvent, globalX: i32);
/// Queries the global X coordinate of the touch event.
///
/// # Arguments
///
/// * `touchEvent` - Touch event object.
///
/// # Returns
///
/// * Global X coordinate.
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub fn OH_Input_GetTouchEventGlobalX(touchEvent: *const Input_TouchEvent) -> i32;
/// Set the global Y coordinate of the touch event.
///
/// # Arguments
///
/// * `touchEvent` - Touch event object.
///
/// * `globalY` - Global Y coordinate.
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub fn OH_Input_SetTouchEventGlobalY(touchEvent: *mut Input_TouchEvent, globalY: i32);
/// Queries the global Y coordinate of the touch event.
///
/// # Arguments
///
/// * `touchEvent` - Touch event object.
///
/// # Returns
///
/// * Global Y coordinate.
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub fn OH_Input_GetTouchEventGlobalY(touchEvent: *const Input_TouchEvent) -> i32;
/// Cancels event injection and revokes authorization.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_CancelInjection();
/// Requests for injection authorization.
///
/// # Arguments
///
/// * `callback` - - callback used to return the result.
///
/// # Returns
///
/// * OH_Input_RequestInjection function result code.
/// [`INPUT_SUCCESS`] Success.
///
/// [`INPUT_PARAMETER_ERROR`] The callback is NULL.
///
/// [`INPUT_DEVICE_NOT_SUPPORTED`] Capability not supported.
///
/// [`INPUT_SERVICE_EXCEPTION`] Service error.
///
/// [`INPUT_INJECTION_AUTHORIZING`] Authorizing.
///
/// [`INPUT_INJECTION_OPERATION_FREQUENT`] Too many operations.
///
/// [`INPUT_INJECTION_AUTHORIZED`] Authorized.
///
/// [`INPUT_INJECTION_AUTHORIZED_OTHERS`] Authorized to other applications.
///
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub fn OH_Input_RequestInjection(callback: Input_InjectAuthorizeCallback) -> Input_Result;
/// Queries the injection authorization status.
///
/// # Arguments
///
/// * `status` - Injection authorization status. For details, see [`Input_InjectionStatus`].
///
/// # Returns
///
/// * OH_Input_QueryAuthorizedStatus function result code.
/// [`INPUT_SUCCESS`] Success.
///
/// [`INPUT_PARAMETER_ERROR`] The status is NULL
///
/// [`INPUT_SERVICE_EXCEPTION`] Service error.
///
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub fn OH_Input_QueryAuthorizedStatus(status: *mut Input_InjectionStatus) -> Input_Result;
/// Creates an axis event object.
///
///
/// # Returns
///
/// * If the operation is successful, a [`Input_AxisEvent`] object is returned.
/// If the operation fails, null is returned.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_CreateAxisEvent() -> *mut Input_AxisEvent;
/// Destroys an axis event object.
///
/// # Arguments
///
/// * `axisEvent` - Pointer to the axis event object.
///
/// # Returns
///
/// * OH_Input_DestroyAxisEvent function result code.
/// [`INPUT_SUCCESS`] Destroys axisEvent success.
///
/// [`INPUT_PARAMETER_ERROR`]The axisEvent is NULL or the *axisEvent is NULL.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_DestroyAxisEvent(axisEvent: *mut *mut Input_AxisEvent) -> Input_Result;
/// Sets the axis event action.
///
/// # Arguments
///
/// * `axisEvent` - Axis event object. For details, see [`Input_AxisEvent`].
///
/// * `action` - Axis event action. The values are defined in [`InputEvent_AxisAction`].
///
/// # Returns
///
/// * OH_Input_SetAxisEventAction function result code.
/// [`INPUT_SUCCESS`] Sets the axis event action success.
///
/// [`INPUT_PARAMETER_ERROR`] The axisEvent is NULL.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_SetAxisEventAction(
axisEvent: *mut Input_AxisEvent,
action: InputEvent_AxisAction,
) -> Input_Result;
/// Obtains the axis event action.
///
/// # Arguments
///
/// * `axisEvent` - Axis event object. For details, see [`Input_AxisEvent`].
///
/// * `action` - Axis event action. The values are defined in [`InputEvent_AxisAction`].
///
/// # Returns
///
/// * OH_Input_GetAxisEventAction function result code.
/// [`INPUT_SUCCESS`] Obtains the axis event action success.
///
/// [`INPUT_PARAMETER_ERROR`] The axisEvent is NULL or the action is NULL.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_GetAxisEventAction(
axisEvent: *const Input_AxisEvent,
action: *mut InputEvent_AxisAction,
) -> Input_Result;
/// Sets the X coordinate of an axis event.
///
/// # Arguments
///
/// * `axisEvent` - Axis event object. For details, see [`Input_AxisEvent`].
///
/// * `displayX` - X coordinate of the axis event.
///
/// # Returns
///
/// * OH_Input_SetAxisEventDisplayX function result code.
/// [`INPUT_SUCCESS`] Sets the X coordinate of the axis event success.
///
/// [`INPUT_PARAMETER_ERROR`] The axisEvent is NULL.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_SetAxisEventDisplayX(
axisEvent: *mut Input_AxisEvent,
displayX: f32,
) -> Input_Result;
/// Obtains the X coordinate of an axis event.
///
/// # Arguments
///
/// * `axisEvent` - Axis event object. For details, see [`Input_AxisEvent`].
///
/// * `displayX` - X coordinate of the axis event.
///
/// # Returns
///
/// * OH_Input_GetAxisEventDisplayX function result code.
/// [`INPUT_SUCCESS`] Obtains the X coordinate of the axis event success.
///
/// [`INPUT_PARAMETER_ERROR`] The axisEvent is NULL or the displayX is NULL.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_GetAxisEventDisplayX(
axisEvent: *const Input_AxisEvent,
displayX: *mut f32,
) -> Input_Result;
/// Sets the Y coordinate of an axis event.
///
/// # Arguments
///
/// * `axisEvent` - Axis event object. For details, see [`Input_AxisEvent`].
///
/// * `displayY` - Y coordinate of the axis event.
///
/// # Returns
///
/// * OH_Input_SetAxisEventDisplayY function result code.
/// [`INPUT_SUCCESS`] Sets the Y coordinate of the axis event success.
///
/// [`INPUT_PARAMETER_ERROR`] The axisEvent is NULL.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_SetAxisEventDisplayY(
axisEvent: *mut Input_AxisEvent,
displayY: f32,
) -> Input_Result;
/// Obtains the Y coordinate of an axis event.
///
/// # Arguments
///
/// * `axisEvent` - Axis event object. For details, see [`Input_AxisEvent`].
///
/// * `displayY` - Y coordinate of the axis event.
///
/// # Returns
///
/// * OH_Input_GetAxisEventDisplayY function result code.
/// [`INPUT_SUCCESS`] Obtains the Y coordinate of the axis event success.
///
/// [`INPUT_PARAMETER_ERROR`] The axisEvent is NULL or the displayY is NULL.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_GetAxisEventDisplayY(
axisEvent: *const Input_AxisEvent,
displayY: *mut f32,
) -> Input_Result;
/// Sets the axis value of the axis type specified by the axis event.
///
/// # Arguments
///
/// * `axisEvent` - Axis event object. For details, see [`Input_AxisEvent`].
///
/// * `axisType` - Axis type. The values are defined in [`InputEvent_AxisType`].
///
/// * `axisValue` - Axis value.
///
/// # Returns
///
/// * OH_Input_SetAxisEventAxisValue function result code.
/// [`INPUT_SUCCESS`] Sets the axis value of the axis event success.
///
/// [`INPUT_PARAMETER_ERROR`] The axisEvent is NULL.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_SetAxisEventAxisValue(
axisEvent: *mut Input_AxisEvent,
axisType: InputEvent_AxisType,
axisValue: f64,
) -> Input_Result;
/// Obtains the axis value for the specified axis type of the axis event.
///
/// # Arguments
///
/// * `axisEvent` - Axis event object. For details, see [`Input_AxisEvent`].
///
/// * `axisType` - Axis type. The values are defined in [`InputEvent_AxisType`].
///
/// * `axisValue` - Axis value.
///
/// # Returns
///
/// * OH_Input_GetAxisEventAxisValue function result code.
/// [`INPUT_SUCCESS`] Obtains the axis value of the axis event success.
///
/// [`INPUT_PARAMETER_ERROR`] The axisEvent is NULL or the axisValue is NULL,
/// or the axisType not found in the axisEvent.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_GetAxisEventAxisValue(
axisEvent: *const Input_AxisEvent,
axisType: InputEvent_AxisType,
axisValue: *mut f64,
) -> Input_Result;
/// Sets the time when an axis event occurs.
///
/// # Arguments
///
/// * `axisEvent` - Axis event object. For details, see [`Input_AxisEvent`].
///
/// * `actionTime` - Time when an axis event occurs.
///
/// # Returns
///
/// * OH_Input_SetAxisEventActionTime function result code.
/// [`INPUT_SUCCESS`] Sets the time when an axis event occurs success.
///
/// [`INPUT_PARAMETER_ERROR`] The axisEvent is NULL.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_SetAxisEventActionTime(
axisEvent: *mut Input_AxisEvent,
actionTime: i64,
) -> Input_Result;
/// Obtains the time when an axis event occurs.
///
/// # Arguments
///
/// * `axisEvent` - Axis event object. For details, see [`Input_AxisEvent`].
///
/// * `actionTime` - Time when an axis event occurs.
///
/// # Returns
///
/// * OH_Input_GetAxisEventActionTime function result code.
/// [`INPUT_SUCCESS`] Obtains the time when an axis event occurs success.
///
/// [`INPUT_PARAMETER_ERROR`] The axisEvent is NULL or the actionTime is NULL.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_GetAxisEventActionTime(
axisEvent: *const Input_AxisEvent,
actionTime: *mut i64,
) -> Input_Result;
/// Sets the axis event type.
///
/// # Arguments
///
/// * `axisEvent` - Axis event object. For details, see [`Input_AxisEvent`].
///
/// * `axisEventType` - Axis event type. The values are defined in [`InputEvent_AxisEventType`].
///
/// # Returns
///
/// * OH_Input_SetAxisEventType function result code.
/// [`INPUT_SUCCESS`] Sets the axis event type success.
///
/// [`INPUT_PARAMETER_ERROR`] The axisEvent is NULL.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_SetAxisEventType(
axisEvent: *mut Input_AxisEvent,
axisEventType: InputEvent_AxisEventType,
) -> Input_Result;
/// Obtains the axis event type.
///
/// # Arguments
///
/// * `axisEvent` - Axis event object.
///
/// * `axisEventType` - Axis event type. The values are defined in [`InputEvent_AxisEventType`].
///
/// # Returns
///
/// * OH_Input_GetAxisEventType function result code.
/// [`INPUT_SUCCESS`] Obtains the axis event type success.
///
/// [`INPUT_PARAMETER_ERROR`] The axisEvent is NULL or the axisEventType is NULL.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_GetAxisEventType(
axisEvent: *const Input_AxisEvent,
axisEventType: *mut InputEvent_AxisEventType,
) -> Input_Result;
/// Sets the axis event source type.
///
/// # Arguments
///
/// * `axisEvent` - Axis event object.
///
/// * `sourceType` - Axis event source type. The values are defined in [`InputEvent_SourceType`].
///
/// # Returns
///
/// * OH_Input_SetAxisEventSourceType function result code.
/// [`INPUT_SUCCESS`] Sets the axis event source type success.
///
/// [`INPUT_PARAMETER_ERROR`] The axisEvent is NULL.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_SetAxisEventSourceType(
axisEvent: *mut Input_AxisEvent,
sourceType: InputEvent_SourceType,
) -> Input_Result;
/// Obtains the axis event source type.
///
/// # Arguments
///
/// * `axisEvent` - Axis event object.
///
/// * `sourceType` - Axis event source type. The values are defined in [`InputEvent_SourceType`].
///
/// # Returns
///
/// * OH_Input_GetAxisEventSourceType function result code.
/// [`INPUT_SUCCESS`] Obtains the axis event source type success.
///
/// [`INPUT_PARAMETER_ERROR`] The axisEvent is NULL or the sourceType is NULL.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_GetAxisEventSourceType(
axisEvent: *const Input_AxisEvent,
sourceType: *mut InputEvent_SourceType,
) -> Input_Result;
/// Sets the windowId of an axis event.
///
/// # Arguments
///
/// * `axisEvent` - Axis event object. For details, see [`Input_AxisEvent`].
///
/// * `windowId` - The windowId for the axis event.
///
/// # Returns
///
/// * OH_Input_SetAxisEventWindowId function result code.
/// [`INPUT_SUCCESS`] Sets the Y coordinate of the axis event success.
///
/// [`INPUT_PARAMETER_ERROR`] The axisEvent is NULL.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 15
#[cfg(feature = "api-15")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
pub fn OH_Input_SetAxisEventWindowId(
axisEvent: *mut Input_AxisEvent,
windowId: i32,
) -> Input_Result;
/// Obtains the windowId of an axis event.
///
/// # Arguments
///
/// * `axisEvent` - Axis event object. For details, see [`Input_AxisEvent`].
///
/// * `windowId` - The windowId for the axis event.
///
/// # Returns
///
/// * OH_Input_GetAxisEventWindowId function result code.
/// [`INPUT_SUCCESS`] Obtains the Y coordinate of the axis event success.
///
/// [`INPUT_PARAMETER_ERROR`] The axisEvent is NULL or the displayY is NULL.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 15
#[cfg(feature = "api-15")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
pub fn OH_Input_GetAxisEventWindowId(
axisEvent: *const Input_AxisEvent,
windowId: *mut i32,
) -> Input_Result;
/// Sets the displayId of an axis event.
///
/// # Arguments
///
/// * `axisEvent` - Axis event object. For details, see [`Input_AxisEvent`].
///
/// * `displayId` - The displayId for the axis event.
///
/// # Returns
///
/// * OH_Input_SetAxisEventDisplayId function result code.
/// [`INPUT_SUCCESS`] Sets the Y coordinate of the axis event success.
///
/// [`INPUT_PARAMETER_ERROR`] The axisEvent is NULL.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 15
#[cfg(feature = "api-15")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
pub fn OH_Input_SetAxisEventDisplayId(
axisEvent: *mut Input_AxisEvent,
displayId: i32,
) -> Input_Result;
/// Obtains the displayId of an axis event.
///
/// # Arguments
///
/// * `axisEvent` - Axis event object. For details, see [`Input_AxisEvent`].
///
/// * `displayId` - The displayId for the axis event.
///
/// # Returns
///
/// * OH_Input_GetAxisEventDisplayId function result code.
/// [`INPUT_SUCCESS`] Obtains the Y coordinate of the axis event success.
///
/// [`INPUT_PARAMETER_ERROR`] The axisEvent is NULL or the displayY is NULL.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 15
#[cfg(feature = "api-15")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
pub fn OH_Input_GetAxisEventDisplayId(
axisEvent: *const Input_AxisEvent,
displayId: *mut i32,
) -> Input_Result;
/// Set the global X coordinate of the axis event.
///
/// # Arguments
///
/// * `axisEvent` - Axis event object. For details, see [`Input_AxisEvent`].
///
/// * `globalX` - Global X coordinate.
///
/// # Returns
///
/// * OH_Input_SetAxisEventGlobalX function result code.
/// [`INPUT_SUCCESS`] Success.
///
/// [`INPUT_PARAMETER_ERROR`] The axisEvent is NULL.
///
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub fn OH_Input_SetAxisEventGlobalX(
axisEvent: *mut Input_AxisEvent,
globalX: i32,
) -> Input_Result;
/// Queries the global X coordinate of the axis event.
///
/// # Arguments
///
/// * `axisEvent` - Axis event object. For details, see [`Input_AxisEvent`].
///
/// * `globalX` - Global X coordinate.
///
/// # Returns
///
/// * OH_Input_GetAxisEventGlobalX function result code.
/// [`INPUT_SUCCESS`] Success.
///
/// [`INPUT_PARAMETER_ERROR`] The axisEvent is NULL or the globalX is NULL.
///
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub fn OH_Input_GetAxisEventGlobalX(
axisEvent: *const Input_AxisEvent,
globalX: *mut i32,
) -> Input_Result;
/// Set the global Y coordinate of the axis event.
///
/// # Arguments
///
/// * `axisEvent` - Axis event object. For details, see [`Input_AxisEvent`].
///
/// * `globalY` - Global Y coordinate.
///
/// # Returns
///
/// * OH_Input_SetAxisEventGlobalY function result code.
/// [`INPUT_SUCCESS`] Success.
///
/// [`INPUT_PARAMETER_ERROR`] The axisEvent is NULL.
///
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub fn OH_Input_SetAxisEventGlobalY(
axisEvent: *mut Input_AxisEvent,
globalY: i32,
) -> Input_Result;
/// Queries the global Y coordinate of the axis event.
///
/// # Arguments
///
/// * `axisEvent` - Axis event object. For details, see [`Input_AxisEvent`].
///
/// * `globalY` - Global Y coordinate.
///
/// # Returns
///
/// * OH_Input_GetAxisEventGlobalY function result code.
/// [`INPUT_SUCCESS`] Success.
///
/// [`INPUT_PARAMETER_ERROR`] The axisEvent is NULL or the globalY is NULL.
///
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub fn OH_Input_GetAxisEventGlobalY(
axisEvent: *const Input_AxisEvent,
globalY: *mut i32,
) -> Input_Result;
/// Adds a listener of key events.
///
/// ohos.permission.INPUT_MONITORING
/// # Arguments
///
/// * `callback` - - Callback used to receive key events.
///
/// # Returns
///
/// * OH_Input_AddKeyEventMonitor function result code.
/// [`INPUT_SUCCESS`] Adds a listener of key events success.
///
/// [`INPUT_PERMISSION_DENIED`] Permission verification failed.
///
/// [`INPUT_PARAMETER_ERROR`] The callback is NULL.
///
/// [`INPUT_SERVICE_EXCEPTION`] Failed to add the monitor because the service is exception.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_AddKeyEventMonitor(callback: Input_KeyEventCallback) -> Input_Result;
/// Adds a listener for mouse events, including mouse click and movement events,
/// but not scroll wheel events. Scroll wheel events are axis events.
///
/// ohos.permission.INPUT_MONITORING
/// # Arguments
///
/// * `callback` - - Callback used to receive mouse events.
///
/// # Returns
///
/// * OH_Input_AddMouseEventMonitor function result code.
/// [`INPUT_SUCCESS`] Adds a listener of mouse events success.
///
/// [`INPUT_PERMISSION_DENIED`] Permission verification failed.
///
/// [`INPUT_PARAMETER_ERROR`] The callback is NULL.
///
/// [`INPUT_SERVICE_EXCEPTION`] Failed to add the monitor because the service is exception.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_AddMouseEventMonitor(callback: Input_MouseEventCallback) -> Input_Result;
/// Add a listener for touch events.
///
/// ohos.permission.INPUT_MONITORING
/// # Arguments
///
/// * `callback` - - Callback used to receive touch events.
///
/// # Returns
///
/// * OH_Input_AddTouchEventMonitor function result code.
/// [`INPUT_SUCCESS`] Adds a listener of touch events success.
///
/// [`INPUT_PERMISSION_DENIED`] Permission verification failed.
///
/// [`INPUT_PARAMETER_ERROR`] The callback is NULL.
///
/// [`INPUT_SERVICE_EXCEPTION`] Failed to add the monitor because the service is exception.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_AddTouchEventMonitor(callback: Input_TouchEventCallback) -> Input_Result;
/// Adds a listener for all types of axis events.
/// The axis event types are defined in [`InputEvent_AxisEventType`].
///
/// ohos.permission.INPUT_MONITORING
/// # Arguments
///
/// * `callback` - - Callback used to receive axis events.
///
/// # Returns
///
/// * OH_Input_AddAxisEventMonitorForAll function result code.
/// [`INPUT_SUCCESS`] Adds a listener for all types of axis events success.
///
/// [`INPUT_PERMISSION_DENIED`] Permission verification failed.
///
/// [`INPUT_PARAMETER_ERROR`] The callback is NULL.
///
/// [`INPUT_SERVICE_EXCEPTION`] Failed to add the monitor because the service is exception.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_AddAxisEventMonitorForAll(callback: Input_AxisEventCallback) -> Input_Result;
/// Adds a listener for the specified type of axis events.
///
/// ohos.permission.INPUT_MONITORING
/// # Arguments
///
/// * `axisEventType` - - Axis event type. The values are defined in [`InputEvent_AxisEventType`].
///
/// * `callback` - - Callback used to receive the specified type of axis events.
///
/// # Returns
///
/// * OH_Input_AddAxisEventMonitor function result code.
/// [`INPUT_SUCCESS`] Adds a listener for the specified types of axis events success.
///
/// [`INPUT_PERMISSION_DENIED`] Permission verification failed.
///
/// [`INPUT_PARAMETER_ERROR`] The callback is NULL.
///
/// [`INPUT_SERVICE_EXCEPTION`] Failed to add the monitor because the service is exception.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_AddAxisEventMonitor(
axisEventType: InputEvent_AxisEventType,
callback: Input_AxisEventCallback,
) -> Input_Result;
/// Removes a key event listener.
///
/// ohos.permission.INPUT_MONITORING
/// # Arguments
///
/// * `callback` - - Callback for the key event listener.
///
/// # Returns
///
/// * OH_Input_RemoveKeyEventMonitor function result code.
/// [`INPUT_SUCCESS`] Removes a key event listener success.
///
/// [`INPUT_PERMISSION_DENIED`] Permission verification failed.
///
/// [`INPUT_PARAMETER_ERROR`] The callback is NULL or has not been added.
///
/// [`INPUT_SERVICE_EXCEPTION`] Fail to remove the monitor because the service is exception.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_RemoveKeyEventMonitor(callback: Input_KeyEventCallback) -> Input_Result;
/// Removes a mouse event listener.
///
/// ohos.permission.INPUT_MONITORING
/// # Arguments
///
/// * `callback` - - Callback for the mouse event listener.
///
/// # Returns
///
/// * OH_Input_RemoveMouseEventMonitor function result code.
/// [`INPUT_SUCCESS`] Removes a mouse event listener success.
///
/// [`INPUT_PERMISSION_DENIED`] Permission verification failed.
///
/// [`INPUT_PARAMETER_ERROR`] The callback is NULL or has not been added.
///
/// [`INPUT_SERVICE_EXCEPTION`] Fail to remove the monitor because the service is exception.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_RemoveMouseEventMonitor(callback: Input_MouseEventCallback) -> Input_Result;
/// Removes a touch event listener.
///
/// ohos.permission.INPUT_MONITORING
/// # Arguments
///
/// * `callback` - - Callback for the touch event listener.
///
/// # Returns
///
/// * OH_Input_RemoveTouchEventMonitor function result code.
/// [`INPUT_SUCCESS`] Removes a touch event listener success.
///
/// [`INPUT_PERMISSION_DENIED`] Permission verification failed.
///
/// [`INPUT_PARAMETER_ERROR`] The callback is NULL or has not been added.
///
/// [`INPUT_SERVICE_EXCEPTION`] Fail to remove the monitor because the service is exception.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_RemoveTouchEventMonitor(callback: Input_TouchEventCallback) -> Input_Result;
/// Removes the listener for all types of axis events.
///
/// ohos.permission.INPUT_MONITORING
/// # Arguments
///
/// * `callback` - - Callback for the listener used to listen for all types of axis events.
///
/// # Returns
///
/// * OH_Input_RemoveAxisEventMonitorForAll function result code.
/// [`INPUT_SUCCESS`] Removes the listener for all types of axis events success.
///
/// [`INPUT_PERMISSION_DENIED`] Permission verification failed.
///
/// [`INPUT_PARAMETER_ERROR`] The callback is NULL or has not been added.
///
/// [`INPUT_SERVICE_EXCEPTION`] Fail to remove the monitor because the service is exception.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_RemoveAxisEventMonitorForAll(callback: Input_AxisEventCallback)
-> Input_Result;
/// Removes the listener for the specified type of axis events.
///
/// ohos.permission.INPUT_MONITORING
/// # Arguments
///
/// * `axisEventType` - - Axis event type. The axis event type is defined in [`InputEvent_AxisEventType`].
///
/// * `callback` - - Callback for the listener used to listen for the specified type of axis events.
///
/// # Returns
///
/// * OH_Input_RemoveAxisEventMonitor function result code.
/// [`INPUT_SUCCESS`] Removes the listener for the specified type of axis events success.
///
/// [`INPUT_PERMISSION_DENIED`] Permission verification failed.
///
/// [`INPUT_PARAMETER_ERROR`] The callback is NULL or has not been added.
///
/// [`INPUT_SERVICE_EXCEPTION`] Fail to remove the monitor because the service is exception.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_RemoveAxisEventMonitor(
axisEventType: InputEvent_AxisEventType,
callback: Input_AxisEventCallback,
) -> Input_Result;
/// Adds a key event interceptor. If multiple interceptors are added, only the first one takes effect.
///
/// ohos.permission.INTERCEPT_INPUT_EVENT
/// # Arguments
///
/// * `callback` - - Callback used to receive key events.
///
/// * `option` - - Options for event interception. If **null** is passed, the default value is used.
///
/// # Returns
///
/// * OH_Input_AddKeyEventInterceptor function result code.
/// [`INPUT_SUCCESS`] Adds a key event interceptor success.
///
/// [`INPUT_PERMISSION_DENIED`] Permission verification failed.
///
/// [`INPUT_PARAMETER_ERROR`] The callback is NULL.
///
/// [`INPUT_REPEAT_INTERCEPTOR`] Interceptor repeatedly created for an application.
///
/// [`INPUT_SERVICE_EXCEPTION`] Failed to add the interceptor because the service is exception.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_AddKeyEventInterceptor(
callback: Input_KeyEventCallback,
option: *mut Input_InterceptorOptions,
) -> Input_Result;
/// Adds an interceptor for input events, including mouse, touch, and axis events.
/// If multiple interceptors are added, only the first one takes effect.
///
/// ohos.permission.INTERCEPT_INPUT_EVENT
/// # Arguments
///
/// * `callback` - - Pointer to the structure of the callback for the input event interceptor.
/// For details, see [`Input_InterceptorEventCallback`].
///
/// * `option` - - Options for event interception. If **null** is passed, the default value is used.
///
/// # Returns
///
/// * OH_Input_AddInputEventInterceptor function result code.
/// [`INPUT_SUCCESS`] Adds an interceptor for input events success.
///
/// [`INPUT_PERMISSION_DENIED`] Permission verification failed.
///
/// [`INPUT_PARAMETER_ERROR`] The callback is NULL.
///
/// [`INPUT_REPEAT_INTERCEPTOR`] Interceptor repeatedly created for an application.
///
/// [`INPUT_SERVICE_EXCEPTION`] Failed to add the interceptor because the service is exception.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_AddInputEventInterceptor(
callback: *mut Input_InterceptorEventCallback,
option: *mut Input_InterceptorOptions,
) -> Input_Result;
/// Removes a key event interceptor.
///
/// ohos.permission.INTERCEPT_INPUT_EVENT
///
/// # Returns
///
/// * OH_Input_RemoveKeyEventInterceptor function result code.
/// [`INPUT_SUCCESS`]Removes a key event interceptor success.
///
/// [`INPUT_PERMISSION_DENIED`] Permission verification failed.
///
/// [`INPUT_SERVICE_EXCEPTION`] Failed to remove the interceptor because the service is exception.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_RemoveKeyEventInterceptor() -> Input_Result;
/// Removes an interceptor for input events, including mouse, touch, and axis events.
///
/// ohos.permission.INTERCEPT_INPUT_EVENT
///
/// # Returns
///
/// * OH_Input_RemoveInputEventInterceptor function result code.
/// [`INPUT_SUCCESS`] Removes an interceptor for input events success.
///
/// [`INPUT_PERMISSION_DENIED`] Permission verification failed.
///
/// [`INPUT_SERVICE_EXCEPTION`] Failed to remove the interceptor because the service is exception.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_Input_RemoveInputEventInterceptor() -> Input_Result;
/// Obtains the interval since the last system input event.
///
/// # Arguments
///
/// * `timeInterval` - Interval, in microseconds.
///
/// # Returns
///
/// * OH_Input_GetIntervalSinceLastInput status code, specifically.
/// [`INPUT_SUCCESS`] if the Operation is successful.
///
/// [`INPUT_SERVICE_EXCEPTION`] Failed to get the interval because the service is exception.
///
/// [`INPUT_PARAMETER_ERROR`] The timeInterval is NULL.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 14
#[cfg(feature = "api-14")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
pub fn OH_Input_GetIntervalSinceLastInput(timeInterval: *mut i64) -> Input_Result;
/// Creates a hot key object.
///
///
/// # Returns
///
/// * Returns an [`Input_Hotkey`] pointer object if the operation is successful. Otherwise, a null pointer is
/// returned. The possible cause is memory allocation failure.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 14
#[cfg(feature = "api-14")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
pub fn OH_Input_CreateHotkey() -> *mut Input_Hotkey;
/// Destroys a hot key object.
///
/// # Arguments
///
/// * `hotkey` - Hot key object.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 14
#[cfg(feature = "api-14")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
pub fn OH_Input_DestroyHotkey(hotkey: *mut *mut Input_Hotkey);
/// Sets a modifier key.
///
/// # Arguments
///
/// * `hotkey` - Hotkey key object.
///
/// * `preKeys` - List of modifier keys.
///
/// * `size` - Number of modifier keys. One or two modifier keys are supported.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 14
#[cfg(feature = "api-14")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
pub fn OH_Input_SetPreKeys(hotkey: *mut Input_Hotkey, preKeys: *mut i32, size: i32);
/// Obtains a modifier key.
///
/// # Arguments
///
/// * `hotkey` - Hotkey key object.
///
/// * `preKeys` - List of modifier keys.
///
/// * `preKeyCount` - Number of modifier keys.
///
/// # Returns
///
/// * OH_Input_GetPreKeys status code, specifically,
/// [`INPUT_SUCCESS`] if the operation is successful;
///
/// [`INPUT_PARAMETER_ERROR`] The hotkey is NULL or the pressedKeys is NULL or the pressedKeyCount
/// is NULL;
///
/// [`INPUT_DEVICE_NOT_SUPPORTED`] Capability not supported.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 14
#[cfg(feature = "api-14")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
pub fn OH_Input_GetPreKeys(
hotkey: *const Input_Hotkey,
preKeys: *mut *mut i32,
preKeyCount: *mut i32,
) -> Input_Result;
/// Sets a modified key.
///
/// # Arguments
///
/// * `hotkey` - Hotkey key object.
///
/// * `finalKey` - Modified key. Only one modified key is supported.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 14
#[cfg(feature = "api-14")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
pub fn OH_Input_SetFinalKey(hotkey: *mut Input_Hotkey, finalKey: i32);
/// Obtains a modified key.
///
/// # Arguments
///
/// * `hotkey` - Hotkey key object.
///
/// * `finalKeyCode` - Returns the key value of the decorated key.
///
/// # Returns
///
/// * OH_Input_GetFinalKey status code, specifically,
/// [`INPUT_SUCCESS`] if the operation is successful;
///
/// [`INPUT_PARAMETER_ERROR`] The hotkey is NULL or the finalKeyCode is NULL;
///
/// [`INPUT_DEVICE_NOT_SUPPORTED`] Capability not supported.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 14
#[cfg(feature = "api-14")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
pub fn OH_Input_GetFinalKey(
hotkey: *const Input_Hotkey,
finalKeyCode: *mut i32,
) -> Input_Result;
/// Creates an array of [`Input_Hotkey`] instances.
///
/// # Arguments
///
/// * `count` - Number of [`Input_Hotkey`] instances to be created. The count must be the same as the number of
/// system shortcut keys.
///
/// # Returns
///
/// * Returns a pointer to an array of [`Input_Hotkey`] instances if the operation is successful. If the
/// operation fails, a null pointer is returned. The possible cause is memory allocation failure or count is not equal
/// to the number of system hotkeys.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 14
#[cfg(feature = "api-14")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
pub fn OH_Input_CreateAllSystemHotkeys(count: i32) -> *mut *mut Input_Hotkey;
/// Destroys an array of [`Input_Hotkey`] instances and reclaims memory.
///
/// # Arguments
///
/// * `hotkeys` - Pointer to an array of [`Input_Hotkey`] instances created by the
/// [`OH_Input_CreateAllSystemHotkeys`] method.
///
/// * `count` - Count of the array to be destroyed, which must be the same as the number of system shortcut keys.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 14
#[cfg(feature = "api-14")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
pub fn OH_Input_DestroyAllSystemHotkeys(hotkeys: *mut *mut Input_Hotkey, count: i32);
/// Obtains all hot keys supported by the system.
///
/// # Arguments
///
/// * `hotkey` - Array of [`Input_Hotkey`] instances.
/// When calling this API for the first time, you can pass NULL to obtain the array length.
///
/// * `count` - Number of hot keys supported by the system.
///
/// # Returns
///
/// * OH_Input_GetAllSystemHotkeys status code, specifically,
/// [`INPUT_SUCCESS`] if the operation is successful;
///
/// [`INPUT_PARAMETER_ERROR`] The hotkey or count is NULL, or the value of count does not match the number
/// of system shortcut keys supported by the system;
/// [`INPUT_DEVICE_NOT_SUPPORTED`] Capability not supported.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 14
#[cfg(feature = "api-14")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
pub fn OH_Input_GetAllSystemHotkeys(
hotkey: *mut *mut Input_Hotkey,
count: *mut i32,
) -> Input_Result;
/// Specifies whether to report repeated key events.
///
/// # Arguments
///
/// * `hotkey` - Shortcut key object.
///
/// * `isRepeat` - Whether to report repeated key events.
/// The value <b>true</b> means to report repeated key events, and the value <b>false</b> means the opposite.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 14
#[cfg(feature = "api-14")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
pub fn OH_Input_SetRepeat(hotkey: *mut Input_Hotkey, isRepeat: bool);
/// Checks whether to report repeated key events.
///
/// # Arguments
///
/// * `hotkey` - Shortcut key object.
///
/// * `isRepeat` - Whether a key event is repeated.
///
/// # Returns
///
/// * OH_Input_GetRepeat status code, specifically,
/// [`INPUT_SUCCESS`] if the operation is successful;
///
/// [`INPUT_PARAMETER_ERROR`] otherwise;
///
/// [`INPUT_DEVICE_NOT_SUPPORTED`] Capability not supported.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 14
#[cfg(feature = "api-14")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
pub fn OH_Input_GetRepeat(hotkey: *const Input_Hotkey, isRepeat: *mut bool) -> Input_Result;
/// Subscribes to shortcut key events.
///
/// # Arguments
///
/// * `hotkey` - Shortcut key object.
///
/// * `callback` - Callback used to return shortcut key events.
///
/// # Returns
///
/// * OH_Input_AddHotkeyMonitor status code, specifically,
/// [`INPUT_SUCCESS`] if the operation is successful;
///
/// [`INPUT_PARAMETER_ERROR`] if hotkey or callback is NULL;
///
/// [`INPUT_DEVICE_NOT_SUPPORTED`] Capability not supported;
///
/// [`INPUT_OCCUPIED_BY_SYSTEM`] The hotkey has been used by the system. You can call the [`GetAllSystemHotkeys`] interface to query all system shortcut keys.
///
/// [`INPUT_OCCUPIED_BY_OTHER`] The hotkey has been subscribed to by another.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 14
#[cfg(feature = "api-14")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
pub fn OH_Input_AddHotkeyMonitor(
hotkey: *const Input_Hotkey,
callback: Input_HotkeyCallback,
) -> Input_Result;
/// Unsubscribes from shortcut key events.
///
/// # Arguments
///
/// * `hotkey` - Shortcut key object.
///
/// * `callback` - Callback used to return shortcut key events.
///
/// # Returns
///
/// * OH_Input_RemoveHotkeyMonitor status code, specifically,
/// [`INPUT_SUCCESS`] if the operation is successful;
///
/// [`INPUT_PARAMETER_ERROR`] if hotkey or callback is NULL;
///
/// [`INPUT_DEVICE_NOT_SUPPORTED`] Capability not supported.
///
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 14
#[cfg(feature = "api-14")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
pub fn OH_Input_RemoveHotkeyMonitor(
hotkey: *const Input_Hotkey,
callback: Input_HotkeyCallback,
) -> Input_Result;
/// Obtains the IDs of all input devices.
///
/// # Arguments
///
/// * `deviceIds` - Array of input device IDs.
///
/// * `inSize` - Size of the array of input device IDs.
///
/// * `outSize` - Length of the list of input device IDs. The value cannot be greater than the value of inSize.
///
/// # Returns
///
/// * OH_Input_GetDeviceIds result code, specifically,
/// [`INPUT_SUCCESS`] if the operation is successful;
/// [`INPUT_PARAMETER_ERROR`] if deviceIds or outSize is a null pointer or inSize is less than 0.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
pub fn OH_Input_GetDeviceIds(
deviceIds: *mut i32,
inSize: i32,
outSize: *mut i32,
) -> Input_Result;
/// Obtains the information about an input device.
///
/// # Arguments
///
/// * `deviceId` - Device ID.
///
/// * `deviceInfo` - Pointer to an [`Input_DeviceInfo`] object.
///
/// # Returns
///
/// * OH_Input_GetDevice result code, specifically,
/// [`INPUT_SUCCESS`] if the operation is successful;
/// [`INPUT_PARAMETER_ERROR`] if the deviceInfo is a null pointer or the deviceId is invalid.
/// You can use the [`OH_Input_GetDeviceIds`] interface to query the device IDs supported by the system.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
pub fn OH_Input_GetDevice(
deviceId: i32,
deviceInfo: *mut *mut Input_DeviceInfo,
) -> Input_Result;
/// Creates a deviceInfo object.
///
///
/// # Returns
///
/// * Pointer to an [`Input_DeviceInfo`] object if the operation is successful;
/// a null pointer otherwise (possibly because of a memory allocation failure).
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
pub fn OH_Input_CreateDeviceInfo() -> *mut Input_DeviceInfo;
/// Destroys a deviceInfo object.
///
/// # Arguments
///
/// * `deviceInfo` - information object. For details, see [`Input_DeviceInfo`].
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
pub fn OH_Input_DestroyDeviceInfo(deviceInfo: *mut *mut Input_DeviceInfo);
/// Obtains the keyboard type of an input device.
///
/// # Arguments
///
/// * `deviceId` - Device ID.
///
/// * `keyboardType` - Pointer to the keyboard type of the input device.
///
/// # Returns
///
/// * OH_Input_GetKeyboardType result code, specifically,
/// [`INPUT_SUCCESS`] if the operation is successful;
/// [`INPUT_PARAMETER_ERROR`] if the device ID is invalid or keyboardType is a null pointer.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
pub fn OH_Input_GetKeyboardType(deviceId: i32, keyboardType: *mut i32) -> Input_Result;
/// Obtains the ID of an input device.
///
/// # Arguments
///
/// * `deviceInfo` - information object. For details, see [`Input_DeviceInfo`].
///
/// * `id` - Pointer to the ID of the input device.
///
/// # Returns
///
/// * OH_Input_GetDeviceId result code, specifically,
/// [`INPUT_SUCCESS`] if the operation is successful;
/// [`INPUT_PARAMETER_ERROR`] if deviceInfo or id is a null pointer.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
pub fn OH_Input_GetDeviceId(deviceInfo: *mut Input_DeviceInfo, id: *mut i32) -> Input_Result;
/// Obtains the name of an input device.
///
/// # Arguments
///
/// * `deviceInfo` - information object. For details, see [`Input_DeviceInfo`].
///
/// * `name` - Pointer to the name of the input device.
///
/// # Returns
///
/// * OH_Input_GetDeviceName result code, specifically,
/// [`INPUT_SUCCESS`] if the operation is successful;
/// [`INPUT_PARAMETER_ERROR`] if deviceInfo or name is a null pointer.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
pub fn OH_Input_GetDeviceName(
deviceInfo: *mut Input_DeviceInfo,
name: *mut *mut ::core::ffi::c_char,
) -> Input_Result;
/// Obtains the capabilities of an input device, for example, a touchscreen, touchpad, or keyboard.
///
/// # Arguments
///
/// * `deviceInfo` - information object. For details, see [`Input_DeviceInfo`].
///
/// * `capabilities` - Pointer to the capabilities of the input device.
///
/// # Returns
///
/// * OH_Input_GetCapabilities result code, specifically,
/// [`INPUT_SUCCESS`] if the operation is successful;
/// [`INPUT_PARAMETER_ERROR`] if deviceInfo or capabilities is a null pointer.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
pub fn OH_Input_GetCapabilities(
deviceInfo: *mut Input_DeviceInfo,
capabilities: *mut i32,
) -> Input_Result;
/// Obtains the version information of an input device.
///
/// # Arguments
///
/// * `deviceInfo` - information object. For details, see [`Input_DeviceInfo`].
///
/// * `version` - Pointer to the version information of the input device.
///
/// # Returns
///
/// * OH_Input_GetDeviceVersion result code, specifically,
/// [`INPUT_SUCCESS`] if the operation is successful;
/// [`INPUT_PARAMETER_ERROR`] if deviceInfo or version is a null pointer.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
pub fn OH_Input_GetDeviceVersion(
deviceInfo: *mut Input_DeviceInfo,
version: *mut i32,
) -> Input_Result;
/// Obtains the product information of an input device.
///
/// # Arguments
///
/// * `deviceInfo` - information object. For details, see [`Input_DeviceInfo`].
///
/// * `product` - Pointer to the product information of the input device.
///
/// # Returns
///
/// * OH_Input_GetDeviceProduct result code, specifically,
/// [`INPUT_SUCCESS`] if the operation is successful;
/// [`INPUT_PARAMETER_ERROR`] if deviceInfo or product is a null pointer.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
pub fn OH_Input_GetDeviceProduct(
deviceInfo: *mut Input_DeviceInfo,
product: *mut i32,
) -> Input_Result;
/// Obtains the vendor information of an input device.
///
/// # Arguments
///
/// * `deviceInfo` - information object. For details, see [`Input_DeviceInfo`].
///
/// * `vendor` - Pointer to the vendor information of the input device.
///
/// # Returns
///
/// * OH_Input_GetDeviceVendor result code, specifically,
/// [`INPUT_SUCCESS`] if the operation is successful;
/// [`INPUT_PARAMETER_ERROR`] if deviceInfo or vendor is a null pointer.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
pub fn OH_Input_GetDeviceVendor(
deviceInfo: *mut Input_DeviceInfo,
vendor: *mut i32,
) -> Input_Result;
/// Obtains the physical address of an input device.
///
/// # Arguments
///
/// * `deviceInfo` - information object. For details, see [`Input_DeviceInfo`].
///
/// * `address` - Pointer to the physical address of the input device.
///
/// # Returns
///
/// * OH_Input_GetDeviceAddress result code, specifically,
/// [`INPUT_SUCCESS`] if the operation is successful;
/// [`INPUT_PARAMETER_ERROR`] if deviceInfo or address is a null pointer.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
pub fn OH_Input_GetDeviceAddress(
deviceInfo: *mut Input_DeviceInfo,
address: *mut *mut ::core::ffi::c_char,
) -> Input_Result;
/// Registers a listener for device hot swap events.
///
/// # Arguments
///
/// * `listener` - Pointer to an [`Input_DeviceListener`] object.
///
///
/// # Returns
///
/// * OH_Input_RegisterDeviceListener status code, specifically,
/// [`INPUT_SUCCESS`] if the operation is successful;
///
/// [`INPUT_PARAMETER_ERROR`] if listener is NULL;
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
pub fn OH_Input_RegisterDeviceListener(listener: *mut Input_DeviceListener) -> Input_Result;
/// Unregisters the listener for device hot swap events.
///
/// # Arguments
///
/// * `listener` - Pointer to the listener for device hot swap events. For details, see [`Input_DeviceListener`].
///
///
/// # Returns
///
/// * OH_Input_UnregisterDeviceListener status code, specifically,
/// [`INPUT_SUCCESS`] if the operation is successful;
///
/// [`INPUT_PARAMETER_ERROR`] if listener is NULL or no listener is registered;
/// [`INPUT_SERVICE_EXCEPTION`] if the service is abnormal.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
pub fn OH_Input_UnregisterDeviceListener(listener: *mut Input_DeviceListener) -> Input_Result;
/// Unregisters the listener for all device hot swap events.
///
///
/// # Returns
///
/// * OH_Input_UnregisterDeviceListeners status code, specifically,
/// [`INPUT_SUCCESS`] if the operation is successful;
///
/// [`INPUT_SERVICE_EXCEPTION`] if the service is abnormal.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
pub fn OH_Input_UnregisterDeviceListeners() -> Input_Result;
/// Obtains the function key status.
///
/// # Arguments
///
/// * `keyCode` - Function key value. Supported function keys include capsLock, NumLock, and ScrollLock.
///
/// * `state` - Function key status. The value 0 indicates that the function key is disabled,
/// and the value 1 indicates the opposite.
///
/// # Returns
///
/// * OH_Input_GetFunctionKeyState function api result code
/// [`INPUT_SUCCESS`] if the operation is successful;
/// [`INPUT_PARAMETER_ERROR`] if keyCode is invalid or state is a null pointer.
/// [`INPUT_KEYBOARD_DEVICE_NOT_EXIST`] no keyboard device connected.
///
/// Required System Capabilities: SystemCapability.MultimodalInput.Input.Core
///
/// Available since API-level: 15
#[cfg(feature = "api-15")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
pub fn OH_Input_GetFunctionKeyState(keyCode: i32, state: *mut i32) -> Input_Result;
/// Queries the maximum number of touch points supported by the current device.
/// If -1 is returned, the number is unknown.
///
/// # Arguments
///
/// * `count` - Maximum number of touch points supported.
///
/// # Returns
///
/// * OH_Input_QueryMaxTouchPoints function api result code
/// [`INPUT_SUCCESS`] if the operation is successful;
/// [`INPUT_PARAMETER_ERROR`] if count is a null pointer.
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub fn OH_Input_QueryMaxTouchPoints(count: *mut i32) -> Input_Result;
/// Get pointer location.
///
/// # Arguments
///
/// * `displayId` - The displayId for the pointer location.
///
/// * `displayX` - The displayX for the pointer location.
///
/// * `displayY` - The displayY for the pointer location.
///
/// # Returns
///
/// * OH_Input_GetPointerLocation function api result code
/// [`INPUT_SUCCESS`] if the operation is successful;
/// [`INPUT_PARAMETER_ERROR`] if parameter is a null pointer;
/// [`INPUT_APP_NOT_FOCUSED`] if the app is not the focused app;
/// [`INPUT_DEVICE_NO_POINTER`] if the device has no pointer;
/// [`INPUT_SERVICE_EXCEPTION`] if the service is exception.
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub fn OH_Input_GetPointerLocation(
displayId: *mut i32,
displayX: *mut f64,
displayY: *mut f64,
) -> Input_Result;
}