X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fcontrollerwidget.cpp;h=0386334a92846cfc21e781c808b21f858101227e;hb=9d399cea8466c7e4a6a1336dafdc830c4680d977;hp=79e91b602859c25b345b4fe1405db8535e624f8d;hpb=10d7ab1fb217c01030a0b637f9a571c1faf61ede;p=virtualjaguar diff --git a/src/gui/controllerwidget.cpp b/src/gui/controllerwidget.cpp index 79e91b6..0386334 100644 --- a/src/gui/controllerwidget.cpp +++ b/src/gui/controllerwidget.cpp @@ -44,6 +44,8 @@ char ControllerWidget::keyName2[64][16] = { char ControllerWidget::hatName[4][16] = { "Up", "Rt", "Dn", "Lf" }; +char ControllerWidget::axisName[2][8] = { "+", "-" }; + // This is hard-coded crap. It's crap-tastic! // These are the positions to draw the button names at, ordered by the BUTTON_* sequence // found in joystick.h. @@ -147,6 +149,11 @@ void ControllerWidget::paintEvent(QPaintEvent * /*event*/) DrawBorderedText(painter, buttonPos[i][0], buttonPos[i][1], QString("j%1").arg(hatName[keys[i] & JOY_BUTTON_MASK])); } + else if (keys[i] & JOY_AXIS) + { + DrawBorderedText(painter, buttonPos[i][0], buttonPos[i][1], + QString("JA%1%2").arg((keys[i] & JOY_AXISNUM_MASK) >> 1).arg(axisName[keys[i] & JOY_AXISDIR_MASK])); + } #endif else DrawBorderedText(painter, buttonPos[i][0], buttonPos[i][1], QString("???"));