Qt: Properly handle modifier keys for input

This commit is contained in:
Connor McLaughlin
2020-01-06 15:14:47 +10:00
parent 6d5eca13a6
commit 87889a13e0
6 changed files with 157 additions and 24 deletions

View File

@ -15,8 +15,7 @@ public:
~InputButtonBindingWidget();
protected:
void keyPressEvent(QKeyEvent* event) override;
void keyReleaseEvent(QKeyEvent* event) override;
bool eventFilter(QObject* watched, QEvent* event) override;
private Q_SLOTS:
void onPressed();
@ -26,10 +25,12 @@ private:
bool isListeningForInput() const { return m_input_listen_timer != nullptr; }
void startListeningForInput();
void stopListeningForInput();
void setNewBinding();
QtHostInterface* m_host_interface;
QString m_setting_name;
QString m_current_binding_value;
QString m_new_binding_value;
QTimer* m_input_listen_timer = nullptr;
u32 m_input_listen_remaining_seconds = 0;
};