Debian Codegraph @

test/litest-device-mouse-virtual.c

raw
1 /*
2 * Copyright © 2025 Ryan Hendrickson
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
22 */
23
24 #include "litest-int.h"
25 #include "litest.h"
26
27 static struct input_id input_id = {
28 .bustype = 0x11,
29 .vendor = 0x1,
30 .product = 0x2,
31 };
32
33 /* clang-format off */
34 static int events[] = {
35 EV_REL, REL_WHEEL,
36 EV_REL, REL_WHEEL_HI_RES,
37 -1, -1,
38 };
39 /* clang-format on */
40
41 static const char quirk_file[] =
42 "[litest Virtual Mouse is virtual]\n"
43 "MatchName=litest Virtual Mouse\n"
44 "AttrIsVirtual=1\n";
45
46 TEST_DEVICE(LITEST_MOUSE_VIRTUAL,
47 .features = LITEST_WHEEL |
48 LITEST_IGNORED, /* Only needed for mouse wheel tests */
49 .interface = NULL,
50
51 .name = "Virtual Mouse",
52 .id = &input_id,
53 .events = events,
54 .absinfo = NULL,
55 .quirk_file = quirk_file, )