diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2000-07-15 16:35:18 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2000-07-15 16:35:18 +0200 |
commit | c9e45322981dbe4c235ad7b9909138626184666f (patch) | |
tree | ee9a63907dc6bf1fff8b208e9ec46bb26589c61f /config.c | |
parent | 744849128df1318b70349223685d9fce8cf805c5 (diff) | |
download | vdr-c9e45322981dbe4c235ad7b9909138626184666f.tar.gz vdr-c9e45322981dbe4c235ad7b9909138626184666f.tar.bz2 |
Fixed/improved LIRC key handling
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: config.c 1.8 2000/07/15 12:39:20 kls Exp $ + * $Id: config.c 1.9 2000/07/15 16:35:18 kls Exp $ */ #include "config.h" @@ -54,6 +54,12 @@ void cKeys::Clear(void) k->code = 0; } +void cKeys::SetDummyValues(void) +{ + for (tKey *k = keys; k->type != kNone; k++) + k->code = k->type + 1; // '+1' to avoid 0 +} + bool cKeys::Load(char *FileName) { isyslog(LOG_INFO, "loading %s", FileName); @@ -150,7 +156,7 @@ unsigned int cKeys::Encode(const char *Command) { if (Command != NULL) { const tKey *k = keys; - while ((k->type != kNone) && strncmp(k->name, Command, strlen(k->name)) != 0) // must use 'strncmp()' because LIRC delivers trailing characters! + while ((k->type != kNone) && strcmp(k->name, Command) != 0) k++; return k->code; } |