1
0

litest-device-sony-vaio-keys.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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/515
  30. */
  31. static struct input_id input_id = {
  32. .bustype = 0x10,
  33. .vendor = 0x104d,
  34. .product = 0x00,
  35. };
  36. /* clang-format off */
  37. static int events[] = {
  38. EV_KEY, KEY_UP,
  39. EV_KEY, KEY_DOWN,
  40. EV_KEY, KEY_MUTE,
  41. EV_KEY, KEY_VOLUMEDOWN,
  42. EV_KEY, KEY_VOLUMEUP,
  43. EV_KEY, KEY_HELP,
  44. EV_KEY, KEY_PROG1,
  45. EV_KEY, KEY_PROG2,
  46. EV_KEY, KEY_BACK,
  47. EV_KEY, KEY_EJECTCD,
  48. EV_KEY, KEY_F13,
  49. EV_KEY, KEY_F14,
  50. EV_KEY, KEY_F15,
  51. EV_KEY, KEY_F21,
  52. EV_KEY, KEY_PROG3,
  53. EV_KEY, KEY_PROG4,
  54. EV_KEY, KEY_SUSPEND,
  55. EV_KEY, KEY_CAMERA,
  56. EV_KEY, KEY_BRIGHTNESSDOWN,
  57. EV_KEY, KEY_BRIGHTNESSUP,
  58. EV_KEY, KEY_MEDIA,
  59. EV_KEY, KEY_SWITCHVIDEOMODE,
  60. EV_KEY, KEY_BLUETOOTH,
  61. EV_KEY, KEY_WLAN,
  62. EV_KEY, BTN_THUMB,
  63. EV_KEY, KEY_VENDOR,
  64. EV_KEY, KEY_FULL_SCREEN,
  65. EV_KEY, KEY_ZOOMIN,
  66. EV_KEY, KEY_ZOOMOUT,
  67. EV_KEY, KEY_FN,
  68. EV_KEY, KEY_FN_ESC,
  69. EV_KEY, KEY_FN_F8,
  70. EV_KEY, KEY_FN_F11,
  71. EV_KEY, KEY_FN_1,
  72. EV_KEY, KEY_FN_2,
  73. EV_KEY, KEY_FN_D,
  74. EV_KEY, KEY_FN_E,
  75. EV_KEY, KEY_FN_F,
  76. EV_KEY, KEY_FN_S,
  77. EV_KEY, KEY_FN_B,
  78. EV_MSC, MSC_SCAN,
  79. -1, -1,
  80. };
  81. /* clang-format on */
  82. TEST_DEVICE(LITEST_SONY_VAIO_KEYS,
  83. .features = LITEST_KEYS,
  84. .interface = NULL,
  85. .name = "Sony Vaio Keys",
  86. .id = &input_id,
  87. .events = events,
  88. .absinfo = NULL,
  89. .udev_properties = {
  90. { "ID_INTEGRATION", "internal" },
  91. { NULL },
  92. }, )