rpcs3/rpcs3/Input/basic_mouse_handler.h
Bevan Weiss ae0e454fc2 Use dynamic_cast to convert QWindow m_target to gs_frame
Used to access get_mouse_lock_state rather than going through the QWindow property tables.

Modify mouse hide and lock to default OFF when entering Windowed mode, and to default ON when entering Fullscreen unless 'show cursor in fullscreen' is configured
2020-09-02 14:22:00 +02:00

29 lines
666 B
C++

#pragma once
#include "stdafx.h"
#include "Emu/Io/MouseHandler.h"
#include "rpcs3qt/gs_frame.h"
#include <QWindow>
#include <QMouseEvent>
#include <QWheelEvent>
class basic_mouse_handler final : public QObject, public MouseHandlerBase
{
Q_OBJECT
public:
virtual void Init(const u32 max_connect) override;
basic_mouse_handler();
void SetTargetWindow(QWindow* target);
void MouseButtonDown(QMouseEvent* event);
void MouseButtonUp(QMouseEvent* event);
void MouseScroll(QWheelEvent* event);
void MouseMove(QMouseEvent* event);
bool eventFilter(QObject* obj, QEvent* ev) override;
private:
QWindow* m_target = nullptr;
bool get_mouse_lock_state();
};