summaryrefslogtreecommitdiff
path: root/source/in_lirc.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2010-06-11 22:16:02 +0000
committerAndrey Nazarov <skuller@skuller.net>2010-06-11 22:16:02 +0000
commitbd091577892489e7d4a2fc83a62dccefababf06b (patch)
tree9f2bd35b7e925f4db2d9d8b29029983469acff70 /source/in_lirc.c
parent2778e48d18a720ec2f94343dc4ca8c335874877d (diff)
Changed LIRC config file syntax: by default console commands are expected and executed, emulated button names should be now prefixed with '@' character.
Diffstat (limited to 'source/in_lirc.c')
-rw-r--r--source/in_lirc.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source/in_lirc.c b/source/in_lirc.c
index b88c8bd..5aec5ef 100644
--- a/source/in_lirc.c
+++ b/source/in_lirc.c
@@ -39,7 +39,7 @@ static cvar_t *lirc_config;
static struct {
qboolean initialized;
struct lirc_config *config;
- int fd;
+ int fd;
ioentry_t *io;
} lirc;
@@ -56,10 +56,15 @@ void Lirc_GetEvents( void ) {
time = Sys_Milliseconds();
Com_DPrintf( "%s: %u %s\n", __func__, time, code );
while( ( ret = lirc_code2char( lirc.config, code, &str ) ) == 0 && str ) {
- key = Key_StringToKeynum( str );
- if( key > 0 ) {
- Key_Event( key, qtrue, time );
- Key_Event( key, qfalse, time );
+ if( *str == '@' ) {
+ key = Key_StringToKeynum( str + 1 );
+ if( key > 0 ) {
+ Key_Event( key, qtrue, time );
+ Key_Event( key, qfalse, time );
+ }
+ } else {
+ Cbuf_AddText( &cmd_buffer, str );
+ Cbuf_AddText( &cmd_buffer, "\n" );
}
}
free( code );