1a46c0ec8Sopenharmony_ci/*
2a46c0ec8Sopenharmony_ci * Copyright © 2020 Red Hat, Inc.
3a46c0ec8Sopenharmony_ci *
4a46c0ec8Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
5a46c0ec8Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
6a46c0ec8Sopenharmony_ci * to deal in the Software without restriction, including without limitation
7a46c0ec8Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8a46c0ec8Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
9a46c0ec8Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
10a46c0ec8Sopenharmony_ci *
11a46c0ec8Sopenharmony_ci * The above copyright notice and this permission notice (including the next
12a46c0ec8Sopenharmony_ci * paragraph) shall be included in all copies or substantial portions of the
13a46c0ec8Sopenharmony_ci * Software.
14a46c0ec8Sopenharmony_ci *
15a46c0ec8Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16a46c0ec8Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17a46c0ec8Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18a46c0ec8Sopenharmony_ci * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19a46c0ec8Sopenharmony_ci * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20a46c0ec8Sopenharmony_ci * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21a46c0ec8Sopenharmony_ci * DEALINGS IN THE SOFTWARE.
22a46c0ec8Sopenharmony_ci */
23a46c0ec8Sopenharmony_ci
24a46c0ec8Sopenharmony_ci#include "config.h"
25a46c0ec8Sopenharmony_ci
26a46c0ec8Sopenharmony_ci#include <assert.h>
27a46c0ec8Sopenharmony_ci
28a46c0ec8Sopenharmony_ci#include "libinput-util.h"
29a46c0ec8Sopenharmony_ci
30a46c0ec8Sopenharmony_ci#include "litest.h"
31a46c0ec8Sopenharmony_ci#include "litest-int.h"
32a46c0ec8Sopenharmony_ci
33a46c0ec8Sopenharmony_ci/* Description taken from
34a46c0ec8Sopenharmony_ci * https://gitlab.freedesktop.org/libinput/libinput/-/issues/514
35a46c0ec8Sopenharmony_ci */
36a46c0ec8Sopenharmony_ci
37a46c0ec8Sopenharmony_cistatic struct input_id input_id = {
38a46c0ec8Sopenharmony_ci	.bustype = 0x3,
39a46c0ec8Sopenharmony_ci	.vendor = 0x46d,
40a46c0ec8Sopenharmony_ci	.product = 0x30f,
41a46c0ec8Sopenharmony_ci};
42a46c0ec8Sopenharmony_ci
43a46c0ec8Sopenharmony_cistatic int events[] = {
44a46c0ec8Sopenharmony_ci	EV_KEY, KEY_MUTE,
45a46c0ec8Sopenharmony_ci	EV_KEY, KEY_VOLUMEDOWN,
46a46c0ec8Sopenharmony_ci	EV_KEY, KEY_VOLUMEUP,
47a46c0ec8Sopenharmony_ci	EV_KEY, KEY_UNDO,
48a46c0ec8Sopenharmony_ci	EV_KEY, KEY_HELP,
49a46c0ec8Sopenharmony_ci	EV_KEY, KEY_CALC,
50a46c0ec8Sopenharmony_ci	EV_KEY, KEY_MAIL,
51a46c0ec8Sopenharmony_ci	EV_KEY, KEY_BOOKMARKS,
52a46c0ec8Sopenharmony_ci	EV_KEY, KEY_BACK,
53a46c0ec8Sopenharmony_ci	EV_KEY, KEY_FORWARD,
54a46c0ec8Sopenharmony_ci	EV_KEY, KEY_NEXTSONG,
55a46c0ec8Sopenharmony_ci	EV_KEY, KEY_PLAYPAUSE,
56a46c0ec8Sopenharmony_ci	EV_KEY, KEY_PREVIOUSSONG,
57a46c0ec8Sopenharmony_ci	EV_KEY, KEY_STOPCD,
58a46c0ec8Sopenharmony_ci	EV_KEY, KEY_REWIND,
59a46c0ec8Sopenharmony_ci	EV_KEY, KEY_CONFIG,
60a46c0ec8Sopenharmony_ci	EV_KEY, KEY_HOMEPAGE,
61a46c0ec8Sopenharmony_ci	EV_KEY, KEY_REDO,
62a46c0ec8Sopenharmony_ci	EV_KEY, KEY_FASTFORWARD,
63a46c0ec8Sopenharmony_ci	EV_KEY, KEY_PRINT,
64a46c0ec8Sopenharmony_ci	EV_KEY, KEY_SEARCH,
65a46c0ec8Sopenharmony_ci	EV_KEY, KEY_SAVE,
66a46c0ec8Sopenharmony_ci	EV_KEY, 319,
67a46c0ec8Sopenharmony_ci	EV_KEY, BTN_TOOL_QUINTTAP,
68a46c0ec8Sopenharmony_ci	EV_KEY, BTN_STYLUS3,
69a46c0ec8Sopenharmony_ci	EV_KEY, BTN_TOUCH,
70a46c0ec8Sopenharmony_ci	EV_KEY, BTN_STYLUS,
71a46c0ec8Sopenharmony_ci	EV_KEY, KEY_ZOOMIN,
72a46c0ec8Sopenharmony_ci	EV_KEY, KEY_ZOOMOUT,
73a46c0ec8Sopenharmony_ci	EV_KEY, KEY_ZOOMRESET,
74a46c0ec8Sopenharmony_ci	EV_KEY, KEY_WORDPROCESSOR,
75a46c0ec8Sopenharmony_ci	EV_KEY, KEY_SPREADSHEET,
76a46c0ec8Sopenharmony_ci	EV_KEY, KEY_PRESENTATION,
77a46c0ec8Sopenharmony_ci	EV_KEY, KEY_MESSENGER,
78a46c0ec8Sopenharmony_ci
79a46c0ec8Sopenharmony_ci	EV_MSC, MSC_SCAN,
80a46c0ec8Sopenharmony_ci	-1, -1,
81a46c0ec8Sopenharmony_ci};
82a46c0ec8Sopenharmony_ci
83a46c0ec8Sopenharmony_ciTEST_DEVICE("logitech-media-keyboard-elite",
84a46c0ec8Sopenharmony_ci	.type = LITEST_KEYBOARD_LOGITECH_MEDIA_KEYBOARD_ELITE,
85a46c0ec8Sopenharmony_ci	.features = LITEST_KEYS,
86a46c0ec8Sopenharmony_ci	.interface = NULL,
87a46c0ec8Sopenharmony_ci
88a46c0ec8Sopenharmony_ci	.name = "Logitech Logitech USB Keyboard Consumer Control",
89a46c0ec8Sopenharmony_ci	.id = &input_id,
90a46c0ec8Sopenharmony_ci	.events = events,
91a46c0ec8Sopenharmony_ci	.absinfo = NULL,
92a46c0ec8Sopenharmony_ci)
93