litest-device-logitech-media-keyboard-elite.c 2.6 KB

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