obs-interaction.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /******************************************************************************
  2. Copyright (C) 2023 by Lain Bailey <lain@obsproject.com>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. ******************************************************************************/
  14. #pragma once
  15. #include "util/c99defs.h"
  16. enum obs_interaction_flags {
  17. INTERACT_NONE = 0,
  18. INTERACT_CAPS_KEY = 1,
  19. INTERACT_SHIFT_KEY = 1 << 1,
  20. INTERACT_CONTROL_KEY = 1 << 2,
  21. INTERACT_ALT_KEY = 1 << 3,
  22. INTERACT_MOUSE_LEFT = 1 << 4,
  23. INTERACT_MOUSE_MIDDLE = 1 << 5,
  24. INTERACT_MOUSE_RIGHT = 1 << 6,
  25. INTERACT_COMMAND_KEY = 1 << 7,
  26. INTERACT_NUMLOCK_KEY = 1 << 8,
  27. INTERACT_IS_KEY_PAD = 1 << 9,
  28. INTERACT_IS_LEFT = 1 << 10,
  29. INTERACT_IS_RIGHT = 1 << 11,
  30. };
  31. enum obs_mouse_button_type {
  32. MOUSE_LEFT,
  33. MOUSE_MIDDLE,
  34. MOUSE_RIGHT,
  35. };
  36. struct obs_mouse_event {
  37. uint32_t modifiers;
  38. int32_t x;
  39. int32_t y;
  40. };
  41. struct obs_key_event {
  42. uint32_t modifiers;
  43. char *text;
  44. uint32_t native_modifiers;
  45. uint32_t native_scancode;
  46. uint32_t native_vkey;
  47. };