mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-27 01:02:48 +01:00
Qt: Implemented EmuWindow touchpad support.
This commit is contained in:
parent
dd73217ae3
commit
f213000cc4
2 changed files with 29 additions and 0 deletions
|
@ -278,6 +278,31 @@ void GRenderWindow::keyReleaseEvent(QKeyEvent* event)
|
|||
Service::HID::PadUpdateComplete();
|
||||
}
|
||||
|
||||
void GRenderWindow::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton) {
|
||||
auto pos = event->pos();
|
||||
EmuWindow::TouchPressed(GetFramebufferLayout(), static_cast<u16>(pos.x()),
|
||||
static_cast<u16>(pos.y()));
|
||||
}
|
||||
}
|
||||
|
||||
void GRenderWindow::mouseMoveEvent(QMouseEvent *event)
|
||||
{
|
||||
auto pos = event->pos();
|
||||
EmuWindow::TouchMoved(GetFramebufferLayout(), static_cast<u16>(pos.x()),
|
||||
static_cast<u16>(pos.y()));
|
||||
}
|
||||
|
||||
void GRenderWindow::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton) {
|
||||
auto pos = event->pos();
|
||||
EmuWindow::TouchReleased(GetFramebufferLayout(), static_cast<u16>(pos.x()),
|
||||
static_cast<u16>(pos.y()));
|
||||
}
|
||||
}
|
||||
|
||||
void GRenderWindow::ReloadSetKeymaps()
|
||||
{
|
||||
KeyMap::SetKeyMapping({Settings::values.pad_a_key, keyboard_id}, Service::HID::PAD_A);
|
||||
|
|
|
@ -121,6 +121,10 @@ public:
|
|||
void keyPressEvent(QKeyEvent* event) override;
|
||||
void keyReleaseEvent(QKeyEvent* event) override;
|
||||
|
||||
void mousePressEvent(QMouseEvent *event) override;
|
||||
void mouseMoveEvent(QMouseEvent *event) override;
|
||||
void mouseReleaseEvent(QMouseEvent *event) override;
|
||||
|
||||
void ReloadSetKeymaps() override;
|
||||
|
||||
void OnClientAreaResized(unsigned width, unsigned height);
|
||||
|
|
Loading…
Reference in a new issue