MCPcopy Create free account
hub / github.com/TASEmulators/fceux / FKBKeyMapDialog

Method FKBKeyMapDialog

src/drivers/Qt/FamilyKeyboard.cpp:1443–1498  ·  view source on GitHub ↗

---------------------------------------------------------------------------- Key Mapping Window

Source from the content-addressed store, hash-verified

1441//****** Key Mapping Window
1442//*********************************************************************************
1443FKBKeyMapDialog::FKBKeyMapDialog( int idx, QWidget *parent )
1444 : QDialog( parent )
1445{
1446 QVBoxLayout *mainLayout;
1447 QHBoxLayout *hbox;
1448 QPushButton *cancelButton;
1449 QLabel *lbl;
1450 char keyMapName[64];
1451 char stmp[128];
1452
1453 setWindowTitle( tr("Family Keyboard Key Mapping") );
1454 setModal(true);
1455
1456 keyIdx = idx;
1457 buttonConfigStatus = 0;
1458 waitingForButton = false;
1459
1460 mainLayout = new QVBoxLayout();
1461 hbox = new QHBoxLayout();
1462
1463 setLayout( mainLayout );
1464
1465 sprintf( stmp, "Press a key to set new physical mapping for the '%s' Key", keyNames[idx*2] );
1466
1467 msgLbl = new QLabel( tr(stmp) );
1468
1469 if (fkbmap[ keyIdx ].ButtType == BUTTC_KEYBOARD)
1470 {
1471 snprintf(keyMapName, sizeof(keyMapName), "%s",
1472 SDL_GetKeyName(fkbmap[ keyIdx ].ButtonNum));
1473 }
1474 else
1475 {
1476 strcpy(keyMapName, ButtonName(&fkbmap[ keyIdx ]));
1477 }
1478
1479 lbl = new QLabel( tr("Current Mapping is:") );
1480 curMapLbl = new QLabel( tr(keyMapName) );
1481
1482 hbox->addWidget( lbl );
1483 hbox->addWidget( curMapLbl );
1484
1485 cancelButton = new QPushButton( tr("Cancel") );
1486 cancelButton->setIcon(style()->standardIcon(QStyle::SP_DialogCancelButton));
1487 cancelButton->setAutoDefault(false);
1488
1489 mainLayout->addWidget( msgLbl );
1490 mainLayout->addLayout( hbox );
1491
1492 hbox = new QHBoxLayout();
1493 mainLayout->addLayout( hbox );
1494 hbox->addWidget( cancelButton, 1 );
1495 hbox->addStretch( 4 );
1496
1497 connect( cancelButton, SIGNAL(clicked(void)), this, SLOT(closeWindow(void)) );
1498}
1499//*********************************************************************************
1500FKBKeyMapDialog::~FKBKeyMapDialog(void)

Callers

nothing calls this directly

Calls 2

ButtonNameFunction · 0.70
trFunction · 0.50

Tested by

no test coverage detected