CommonHostInterface: Add controller nav helpers

This commit is contained in:
Connor McLaughlin
2021-01-30 21:25:49 +10:00
parent 61d0af30a2
commit 3a7d9f1725
3 changed files with 52 additions and 1 deletions

View File

@ -19,7 +19,21 @@ class ControllerInterface;
namespace FrontendCommon {
class SaveStateSelectorUI;
}
enum class ControllerNavigationButton : u32
{
Activate, // A on XBox Controller, Cross on PS Controller
Cancel, // B on XBox Controller, Circle on PS Controller
LeftShoulder, // LB on XBox Controller, L1 on PS Controller
RightShoulder, // RB on XBox Controller, R1 on PS Controller
DPadLeft,
DPadRight,
DPadUp,
DPadDown,
Count
};
} // namespace FrontendCommon
class CommonHostInterface : public HostInterface
{
@ -234,6 +248,10 @@ public:
/// This is the APK for Android builds, or the program directory for standalone builds.
virtual std::unique_ptr<ByteStream> OpenPackageFile(const char* path, u32 flags) override;
/// Controller navigation, used by fullscreen mode. Returns true if the UI consumed the event, and it should not
/// execute the normal handler.
bool SetControllerNavigationButtonState(FrontendCommon::ControllerNavigationButton button, bool pressed);
/// Toggles fast forward state.
bool IsFastForwardEnabled() const { return m_fast_forward_enabled; }
void SetFastForwardEnabled(bool enabled);