Ticket #182: lcdkeys.diff
File lcdkeys.diff, 4.5 KB (added by , 19 years ago) |
---|
-
libs/libmythtv/siscan.h
31 31 typedef void* NIT; 32 32 #endif // USING_DVB 33 33 34 #define USE_OWN_SIPARSER34 //#define USE_OWN_SIPARSER 35 35 #define DVB_QUICKSCAN 36 36 37 37 #define SISCAN(args...) \ -
libs/libmythtv/siscan.cpp
158 158 void *SIScan::SpawnSectionReader(void *param) 159 159 { 160 160 DVBSIParser *siparser = (DVBSIParser*) param; 161 #ifdef USING_DVB 161 162 siparser->StartSectionReader(); 163 #endif 162 164 return NULL; 163 165 } 164 166 -
libs/libmyth/lcddevice.cpp
416 416 { 417 417 int key = 0; 418 418 419 char mykey = key_pressed.ascii()[0]; 420 switch (mykey) 421 { 422 case LCD_KEY_UP: key = Qt::Key_Up; break; 423 case LCD_KEY_DOWN: key = Qt::Key_Down; break; 424 case LCD_KEY_LEFT: key = Qt::Key_Left; break; 425 case LCD_KEY_RIGHT: key = Qt::Key_Right; break; 426 case LCD_KEY_YES: key = Qt::Key_Space; break; 427 case LCD_KEY_NO: key = Qt::Key_Escape; break; 428 default: break; 429 } 419 QChar mykey = key_pressed.at(0); 420 if (mykey == lcd_keystring.at(0)) 421 key = Qt::Key_Up; 422 else if (mykey == lcd_keystring.at(1)) 423 key = Qt::Key_Down; 424 else if (mykey == lcd_keystring.at(2)) 425 key = Qt::Key_Left; 426 else if (mykey == lcd_keystring.at(3)) 427 key = Qt::Key_Right; 428 else if (mykey == lcd_keystring.at(4)) 429 key = Qt::Key_Space; 430 else if (mykey == lcd_keystring.at(5)) 431 key = Qt::Key_Escape; 430 432 431 433 QApplication::postEvent(gContext->GetMainWindow(), 432 434 new ExternalKeycodeEvent(key)); … … 453 455 lcd_heartbeaton=(gContext->GetSetting("LCDHeartBeatOn", "1")=="1"); 454 456 aString = gContext->GetSetting("LCDPopupTime", "5"); 455 457 lcd_popuptime = aString.toInt() * 1000; 458 lcd_keystring = gContext->GetSetting("LCDKeyString", "ABCDEF"); 456 459 457 460 connected = TRUE; 458 461 … … 460 463 // indicating that "hello" was succesful 461 464 462 465 sendToServer("client_set name Myth"); 463 sendToServer("client_add_key ABCDEF"); 466 aString = "client_add_key " + lcd_keystring; 467 sendToServer(aString); 464 468 465 469 // Create all the screens and widgets (when we change activity in the myth 466 470 // program, we just swap the priorities of the screens to show only the -
libs/libmyth/lcddevice.h
11 11 12 12 using namespace std; 13 13 14 #define LCD_KEY_UP 'A'15 #define LCD_KEY_LEFT 'B'16 #define LCD_KEY_DOWN 'C'17 #define LCD_KEY_RIGHT 'D'18 #define LCD_KEY_YES 'E'19 #define LCD_KEY_NO 'F'20 21 14 enum CHECKED_STATE {CHECKED = 0, UNCHECKED, NOTCHECKABLE }; 22 15 23 16 class LCDMenuItem … … 308 301 bool lcd_heartbeaton; 309 302 int lcd_popuptime; 310 303 QString lcd_showmusic_items; 311 304 QString lcd_keystring; 305 312 306 int (*GetLEDMask)(void); 313 307 }; 314 308 -
programs/mythfrontend/globalsettings.cpp
2553 2553 return gc; 2554 2554 } 2555 2555 2556 static HostLineEdit *LCDKeyString() 2557 { 2558 HostLineEdit *ge = new HostLineEdit("LCDKeyString"); 2559 ge->setLabel(QObject::tr("LCD Key order")); 2560 ge->setValue("ABCDEF"); 2561 ge->setHelpText(QObject::tr("Enter the 6 Keypad Return Codes for your " 2562 "LCD keypad in the order in which you want the functions " 2563 "up/down/left/right/yes/no to operate. " 2564 "(See lcdproc/server/drivers/hd44780.c/keyMapMatrix[] " 2565 "or the matrix for your display)")); 2566 return ge; 2567 } 2568 2556 2569 static HostCheckBox *LCDEnable() 2557 2570 { 2558 2571 HostCheckBox *gc = new HostCheckBox("LCDEnable"); … … 2590 2603 setRight->addChild(LCDShowGeneric()); 2591 2604 setRight->addChild(LCDBacklightOn()); 2592 2605 setRight->addChild(LCDHeartBeatOn()); 2606 setRight->addChild(LCDKeyString()); 2593 2607 setHoriz->addChild(setLeft); 2594 2608 setHoriz->addChild(setRight); 2595 2609 settings->addChild(setHoriz);