Qt: Implement relative mouse mode

This commit is contained in:
Connor McLaughlin
2020-12-27 14:08:13 +10:00
parent 114d4a2c1d
commit ca42d027ac
13 changed files with 116 additions and 8 deletions

View File

@ -917,20 +917,28 @@ void HostInterface::UpdateSoftwareCursor()
{
if (System::IsShutdown())
{
SetMouseMode(false, false);
m_display->ClearSoftwareCursor();
return;
}
const Common::RGBA8Image* image = nullptr;
float image_scale = 1.0f;
bool relative_mode = false;
bool hide_cursor = false;
for (u32 i = 0; i < NUM_CONTROLLER_AND_CARD_PORTS; i++)
{
Controller* controller = System::GetController(i);
if (controller && controller->GetSoftwareCursor(&image, &image_scale))
if (controller && controller->GetSoftwareCursor(&image, &image_scale, &relative_mode))
{
hide_cursor = true;
break;
}
}
SetMouseMode(relative_mode, hide_cursor);
if (image && image->IsValid())
{
m_display->SetSoftwareCursor(image->GetPixels(), image->GetWidth(), image->GetHeight(), image->GetByteStride(),
@ -967,6 +975,8 @@ void HostInterface::RecreateSystem()
System::ResetPerformanceCounters();
}
void HostInterface::SetMouseMode(bool relative, bool hide_cursor) {}
void HostInterface::DisplayLoadingScreen(const char* message, int progress_min /*= -1*/, int progress_max /*= -1*/,
int progress_value /*= -1*/)
{