X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fcontrollerwidget.cpp;h=f268c00ce65267f181886866045348d0e08f8558;hb=2e7108fbe3b1a8a42f155069e4648d43fda57789;hp=eb91c34274ea28666dbd020a8e7e74e522de395d;hpb=94d59c2c8c14b9ac51dffd117ec507418b4d0881;p=virtualjaguar diff --git a/src/gui/controllerwidget.cpp b/src/gui/controllerwidget.cpp index eb91c34..f268c00 100644 --- a/src/gui/controllerwidget.cpp +++ b/src/gui/controllerwidget.cpp @@ -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();