summaryrefslogtreecommitdiffhomepage
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/keyboard.h4
-rw-r--r--gui/options-dialog.cpp13
2 files changed, 10 insertions, 7 deletions
diff --git a/gui/keyboard.h b/gui/keyboard.h
index aa4b4a24..b840bc78 100644
--- a/gui/keyboard.h
+++ b/gui/keyboard.h
@@ -22,7 +22,7 @@ public:
{
if(k.guid != "")
{
- joystick_button_pressed(k.guid, k.keycode);
+ joystick_button_pressed(k.guid, k.keycode, k.held);
}
else
{
@@ -54,5 +54,5 @@ public:
#endif
signals:
void key_pressed(QKeySequence k);
- void joystick_button_pressed(QString guid, int idx);
+ void joystick_button_pressed(QString guid, int idx, bool held);
};
diff --git a/gui/options-dialog.cpp b/gui/options-dialog.cpp
index c8bf668d..4cff6e77 100644
--- a/gui/options-dialog.cpp
+++ b/gui/options-dialog.cpp
@@ -90,11 +90,14 @@ void OptionsDialog::bind_key(Shortcuts::key_opts& kopts, QLabel* label)
kopts.button = -1;
d.close();
});
- connect(k, &KeyboardListener::joystick_button_pressed, [&](QString guid, int idx) -> void {
- kopts.guid = guid;
- kopts.keycode = "";
- kopts.button = idx;
- d.close();
+ connect(k, &KeyboardListener::joystick_button_pressed, [&](QString guid, int idx, bool held) -> void {
+ if (!held)
+ {
+ kopts.guid = guid;
+ kopts.keycode = "";
+ kopts.button = idx;
+ d.close();
+ }
});
d.exec();
label->setText(kopts_to_string(kopts));