]> Shamusworld >> Repos - virtualjaguar/blobdiff - src/gui/controllerwidget.cpp
Added region specific test pattern for correctness' sake. ;-)
[virtualjaguar] / src / gui / controllerwidget.cpp
index 0386334a92846cfc21e781c808b21f858101227e..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",
        "!", "\"", "#", "$", "%", "&", "'", "(", ")", "*", "+", ",", "-", ".", "/",
@@ -65,6 +65,8 @@ ControllerWidget::ControllerWidget(QWidget * parent/*= 0*/): QWidget(parent),
        widgetSize += QSize(4, 4);
        // We want to know when the mouse is moving over our widget...
        setMouseTracking(true);
+//nope
+//setFixedSize(widgetSize);
 }
 
 
@@ -171,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);
@@ -180,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();