summaryrefslogtreecommitdiffhomepage
path: root/gui/keyboard.h
blob: f4e5f7c0ec724d2f6d175a01fe501cf0b5bba279 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once

#ifdef _WIN32
#   include "logic/win32-shortcuts.h"
#   include "dinput/keybinding-worker.hpp"
#endif

#include "ui_keyboard_listener.h"

#include <QDialog>
#include <QKeyEvent>

class KeyboardListener : public QDialog
{
    Q_OBJECT
    Ui_keyboard_listener ui;
#ifdef _WIN32
    KeybindingWorker::Token token;
#endif
public:
    KeyboardListener(QWidget* parent = nullptr);
#ifndef _WIN32
    void keyPressEvent(QKeyEvent* event) override;
#endif
signals:
    void key_pressed(QKeySequence k);
    void joystick_button_pressed(QString guid, int idx, bool held);
};