hotkeys.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. struct InputHotkey {
  2. InputHotkey(string_view name);
  3. auto poll() -> void;
  4. const string name;
  5. string identifier;
  6. shared_pointer<HID::Device> device;
  7. uint pathID = 0;
  8. uint vendorID = 0;
  9. uint productID = 0;
  10. uint groupID = 0;
  11. uint inputID = 0;
  12. bool oldValue = 0;
  13. bool newValue = 0;
  14. function<void ()> onPress;
  15. function<void ()> onRelease;
  16. };
  17. struct Hotkeys {
  18. Hotkeys();
  19. auto poll() -> void;
  20. auto bind() -> void;
  21. InputHotkey toggleStatus{"Toggle Status Bar"};
  22. InputHotkey togglePanels{"Toggle System Panels"};
  23. InputHotkey toggleFullscreen{"Toggle Fullscreen"};
  24. InputHotkey toggleMouseCapture{"Toggle Mouse Capture"};
  25. InputHotkey fastForward{"Fast Forward"};
  26. InputHotkey saveState{"Save State"};
  27. InputHotkey loadState{"Load State"};
  28. InputHotkey incrementStateSlot{"Increment State Slot"};
  29. InputHotkey decrementStateSlot{"Decrement State Slot"};
  30. InputHotkey pauseEmulation{"Pause Emulation"};
  31. InputHotkey exportMemory{"Export Memory"};
  32. InputHotkey quitEmulator{"Quit Emulator"};
  33. vector<InputHotkey*> hotkeys;
  34. private:
  35. uint stateSlot = 1;
  36. bool fastForwardVideoBlocking = false;
  37. bool fastForwardAudioBlocking = false;
  38. bool fastForwardAudioDynamic = false;
  39. };