input.hpp 846 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include "hotkeys.hpp"
  2. struct InputAxis {
  3. auto value() -> int16_t;
  4. const string name;
  5. shared_pointer<HID::Device> device;
  6. uint groupID;
  7. uint inputID;
  8. };
  9. struct InputButton {
  10. auto value() -> int16_t;
  11. const string name;
  12. shared_pointer<HID::Device> device;
  13. uint groupID;
  14. uint inputID;
  15. enum class Qualifier : uint { None, Lo, Hi } qualifier = Qualifier::None;
  16. };
  17. struct InputManager {
  18. auto bind(maybe<higan::Node::Object> root = {}) -> void;
  19. auto unbind() -> void;
  20. auto poll() -> void;
  21. auto eventInput(shared_pointer<HID::Device>, uint group, uint input, int16_t oldValue, int16_t newValue) -> void;
  22. higan::Node::Object root;
  23. vector<shared_pointer<HID::Device>> devices;
  24. Hotkeys hotkeys;
  25. uint64_t pollFrequency = 5;
  26. uint64_t lastPoll = 0;
  27. };
  28. extern InputManager inputManager;
  29. extern Hotkeys& hotkeys;