Debian Codegraph @

test/litest-device-logitech-media-keyboard-elite.c

raw
1 /*
2 * Copyright © 2020 Red Hat, Inc.
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 "config.h"
25
26 #include <assert.h>
27
28 #include "libinput-util.h"
29 #include "litest-int.h"
30 #include "litest.h"
31
32 /* Description taken from
33 * https://gitlab.freedesktop.org/libinput/libinput/-/issues/514
34 */
35
36 static struct input_id input_id = {
37 .bustype = 0x3,
38 .vendor = 0x46d,
39 .product = 0x30f,
40 };
41
42 /* clang-format off */
43 static int events[] = {
44 EV_KEY, KEY_MUTE,
45 EV_KEY, KEY_VOLUMEDOWN,
46 EV_KEY, KEY_VOLUMEUP,
47 EV_KEY, KEY_UNDO,
48 EV_KEY, KEY_HELP,
49 EV_KEY, KEY_CALC,
50 EV_KEY, KEY_MAIL,
51 EV_KEY, KEY_BOOKMARKS,
52 EV_KEY, KEY_BACK,
53 EV_KEY, KEY_FORWARD,
54 EV_KEY, KEY_NEXTSONG,
55 EV_KEY, KEY_PLAYPAUSE,
56 EV_KEY, KEY_PREVIOUSSONG,
57 EV_KEY, KEY_STOPCD,
58 EV_KEY, KEY_REWIND,
59 EV_KEY, KEY_CONFIG,
60 EV_KEY, KEY_HOMEPAGE,
61 EV_KEY, KEY_REDO,
62 EV_KEY, KEY_FASTFORWARD,
63 EV_KEY, KEY_PRINT,
64 EV_KEY, KEY_SEARCH,
65 EV_KEY, KEY_SAVE,
66 EV_KEY, 319,
67 EV_KEY, BTN_TOOL_QUINTTAP,
68 EV_KEY, BTN_STYLUS3,
69 EV_KEY, BTN_TOUCH,
70 EV_KEY, BTN_STYLUS,
71 EV_KEY, KEY_ZOOMIN,
72 EV_KEY, KEY_ZOOMOUT,
73 EV_KEY, KEY_ZOOMRESET,
74 EV_KEY, KEY_WORDPROCESSOR,
75 EV_KEY, KEY_SPREADSHEET,
76 EV_KEY, KEY_PRESENTATION,
77 EV_KEY, KEY_MESSENGER,
78
79 EV_MSC, MSC_SCAN,
80 -1, -1,
81 };
82 /* clang-format on */
83
84 TEST_DEVICE(LITEST_KEYBOARD_LOGITECH_MEDIA_KEYBOARD_ELITE,
85 .features = LITEST_KEYS,
86 .interface = NULL,
87
88 .name = "Logitech Logitech USB Keyboard Consumer Control",
89 .id = &input_id,
90 .events = events,
91 .absinfo = NULL, )