Qt: Implement hotkeys (+ configuration)

This commit is contained in:
spycrab
2017-06-06 13:49:49 +02:00
parent 096399d371
commit 151ae38a56
24 changed files with 958 additions and 3 deletions

View File

@ -0,0 +1,19 @@
// Copyright 2017 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#include <QEvent>
#include <QObject>
#include "DolphinQt2/QtUtils/FocusEventFilter.h"
bool FocusEventFilter::eventFilter(QObject* object, QEvent* event)
{
if (event->type() == QEvent::FocusOut)
emit focusOutEvent();
if (event->type() == QEvent::FocusIn)
emit focusInEvent();
return false;
}

View File

@ -0,0 +1,18 @@
// Copyright 2017 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <QObject>
class FocusEventFilter : public QObject
{
Q_OBJECT
signals:
void focusInEvent();
void focusOutEvent();
private:
bool eventFilter(QObject* object, QEvent* event) override;
};