X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=inline;f=src%2Fgui%2Fkeygrabber.cpp;h=23954b855450c65fa765e984c022ddb8130c61c4;hb=253f7b2713969c4982a3149c55e378db51d7791d;hp=371c61991122a3d2a700a96b8ad8e90b37d89251;hpb=166019baeee39e3867ecf6c4eddd0855dc3507a4;p=virtualjaguar
diff --git a/src/gui/keygrabber.cpp b/src/gui/keygrabber.cpp
index 371c619..23954b8 100644
--- a/src/gui/keygrabber.cpp
+++ b/src/gui/keygrabber.cpp
@@ -21,20 +21,32 @@ KeyGrabber::KeyGrabber(QWidget * parent/*= 0*/): QDialog(parent)
mainLayout->addWidget(label);
setLayout(mainLayout);
setWindowTitle(tr("Grab"));
+
+ // Will this make Mac OSX work???
+ setFocusPolicy(Qt::StrongFocus);
}
KeyGrabber::~KeyGrabber()
{
}
-void KeyGrabber::SetText(QString keyText)
+//void KeyGrabber::SetText(QString keyText)
+void KeyGrabber::SetKeyText(int keyNum)
{
- QString text = QString(tr("Press key for \"%1\"
(ESC to cancel)")).arg(keyText);
+ char jagButtonName[21][10] = { "Up", "Down", "Left", "Right",
+ "*", "7", "4", "1", "0", "8", "5", "2", "#", "9", "6", "3",
+ "A", "B", "C", "Option", "Pause" };
+
+ QString text = QString(tr("Press key for \"%1\"
(ESC to cancel)"))
+ .arg(QString(jagButtonName[keyNum]));
label->setText(text);
}
void KeyGrabber::keyPressEvent(QKeyEvent * e)
{
key = e->key();
- accept();
+
+ // Since this is problematic, we don't allow this key...
+ if (key != Qt::Key_Alt)
+ accept();
}