1
0

litest-device-mouse-virtual.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. #include "litest-int.h"
  24. #include "litest.h"
  25. static struct input_id input_id = {
  26. .bustype = 0x11,
  27. .vendor = 0x1,
  28. .product = 0x2,
  29. };
  30. /* clang-format off */
  31. static int events[] = {
  32. EV_REL, REL_WHEEL,
  33. EV_REL, REL_WHEEL_HI_RES,
  34. -1, -1,
  35. };
  36. /* clang-format on */
  37. static const char quirk_file[] =
  38. "[litest Virtual Mouse is virtual]\n"
  39. "MatchName=litest Virtual Mouse\n"
  40. "AttrIsVirtual=1\n";
  41. TEST_DEVICE(LITEST_MOUSE_VIRTUAL,
  42. .features = LITEST_WHEEL |
  43. LITEST_IGNORED, /* Only needed for mouse wheel tests */
  44. .interface = NULL,
  45. .name = "Virtual Mouse",
  46. .id = &input_id,
  47. .events = events,
  48. .absinfo = NULL,
  49. .quirk_file = quirk_file,
  50. .udev_properties = {
  51. { "ID_INTEGRATION", "internal" },
  52. { NULL },
  53. }, )