]> Shamusworld >> Repos - virtualjaguar/blobdiff - src/gui/controllerwidget.cpp
Possible fix for gamepad 'Select All Keys' problem.
[virtualjaguar] / src / gui / controllerwidget.cpp
index eb91c34274ea28666dbd020a8e7e74e522de395d..f268c00ce65267f181886866045348d0e08f8558 100644 (file)
@@ -19,8 +19,8 @@
 #include "keygrabber.h"
 
 
-// These tables are used to convert Qt keycodes into human readable form. Note that
-// a lot of these are just filler.
+// These tables are used to convert Qt keycodes into human readable form. Note
+// that a lot of these are just filler.
 char ControllerWidget::keyName1[96][16] = {
        "Space",
        "!", "\"", "#", "$", "%", "&", "'", "(", ")", "*", "+", ",", "-", ".", "/",
@@ -173,7 +173,8 @@ void ControllerWidget::mousePressEvent(QMouseEvent * /*event*/)
 void ControllerWidget::mouseReleaseEvent(QMouseEvent * /*event*/)
 {
        mouseDown = false;
-       // Spawning the keygrabber causes leaveEvent() to be called, so we need to save this
+       // Spawning the keygrabber causes leaveEvent() to be called, so we need to
+       // save this
        int keyToHighlightSave = keyToHighlight;
 
        KeyGrabber keyGrab(this);
@@ -182,7 +183,10 @@ void ControllerWidget::mouseReleaseEvent(QMouseEvent * /*event*/)
        int key = keyGrab.key;
 
        if (key != Qt::Key_Escape)
+       {
                keys[keyToHighlightSave] = key;
+               emit(KeyDefined(keyToHighlightSave, key));
+       }
 
        keyToHighlight = keyToHighlightSave;
        update();