[mythtv] [PATCH] lcdproc CVS compatibility
Tom Scofield
tscofield at gmail.com
Mon May 16 00:04:19 UTC 2005
It appears that the key press API with the cvs version of lcdproc has
changed. Below is a patch that seems to work. It does not test for
the version but should work with either version.
--- lcddevice.cpp.patched 2005-05-10 13:35:19.000000000 -0400
+++ lcddevice.cpp 2005-05-10 23:43:38.000000000 -0400
@@ -310,8 +310,21 @@
"that it doesn't understand" << endl;
cerr << "last command: " << last_command << endl;
}
- else if (aList.first() == "key")
- handleKeyPress(aList.last().stripWhiteSpace());
+ else if (aList.first() == "key") {
+ if (aList.last() == "Up\n")
+ aList.last()=LCD_KEY_UP;
+ else if (aList.last() == "Down\n")
+ aList.last()=LCD_KEY_DOWN;
+ else if (aList.last() == "Left\n")
+ aList.last()=LCD_KEY_LEFT;
+ else if (aList.last() == "Right\n")
+ aList.last()=LCD_KEY_RIGHT;
+ else if (aList.last() == "Enter\n")
+ aList.last()=LCD_KEY_YES;
+ else if (aList.last() == "Escape\n")
+ aList.last()=LCD_KEY_NO;
+ handleKeyPress(aList.last().stripWhiteSpace());
+ }
}
}
@@ -362,6 +375,12 @@
sendToServer("client_set name Myth");
sendToServer("client_add_key ABCDEF");
+ sendToServer("client_add_key Up");
+ sendToServer("client_add_key Down");
+ sendToServer("client_add_key Left");
+ sendToServer("client_add_key Right");
+ sendToServer("client_add_key Enter");
+ sendToServer("client_add_key Escape");
// Create all the screens and widgets (when we change activity in the myth
// program, we just swap the priorities of the screens to show only the
>This patch affects lcddevice.cpp and lcddevice.h in libs/libmyth. The patch
>allows for compatibility with lcdproc CVS version 0.5, while maintaining
>compatibility with the current stable release of lcdproc. This is
needed because
>the hd44780 display often becomes corrupted and unusable in the current stable
>version of lcdproc. This is fixed in the CVS version, along with
support for the
>filled block character.
>
>The patch has been tested with lcdproc-0.4.5 and lcdproc-CVS-20050418 with the
>curses and hd44780 displays.
>The CVS version of lcdproc has two differences from the 0.4.x versions. The
>first is that the priority meaning has changed. In 0.4.x, the screen with the
>lowest priority number is displayed. In CVS, the screen with the highest
>priority number is displayed. In 0.4.x, to remove the heartbeat the following
>command is issued: "widget_del <screen> heartbeat". In CVS, to remove the
>heartbeat the following command is issued: "screen_set <screen> heartbeat off".
>
>The patch detects which version of lcdproc is being used. If 0.4.x is used, the
>original calls are left untouched. If anything else is used, the commands are
>switched to the CVS versions of the commands as described above.
>
>Thank you,
>Chase Douglas
More information about the mythtv-dev
mailing list