summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'config.c')
-rw-r--r--config.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/config.c b/config.c
index 0a965ee..e161efd 100644
--- a/config.c
+++ b/config.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: config.c 1.22 2000/09/10 15:07:15 kls Exp $
+ * $Id: config.c 1.23 2000/09/17 09:11:59 kls Exp $
*/
#include "config.h"
@@ -155,14 +155,22 @@ eKeys cKeys::Get(unsigned int Code)
return kNone;
}
-unsigned int cKeys::Encode(const char *Command)
+eKeys cKeys::Translate(const char *Command)
{
- if (Command != NULL) {
+ if (Command) {
const tKey *k = keys;
- while ((k->type != kNone) && strcmp(k->name, Command) != 0)
+ while ((k->type != kNone) && strcasecmp(k->name, Command) != 0)
k++;
- return k->code;
+ return k->type;
}
+ return kNone;
+}
+
+unsigned int cKeys::Encode(const char *Command)
+{
+ eKeys k = Translate(Command);
+ if (k != kNone)
+ return keys[k].code;
return 0;
}