--- slim/Slim/Hardware/IR.pm 2004-08-27 23:53:00.000000000 -0700 +++ slimnew/Slim/Hardware/IR.pm 2004-09-01 12:41:37.000000000 -0700 @@ -119,10 +119,10 @@ sub mapfiles { $::d_ir && msg(" key mapping file entry: $mapfile\n"); my $path = catdir($irfiledir,$mapfile); if ($1 eq defaultMap()) { - $maplist{$path} = Slim::Utils::Strings::string('DEFAULT_MAP'); - $defaultMapFile = $path + $maplist{$mapfile} = Slim::Utils::Strings::string('DEFAULT_MAP'); + $defaultMapFile = $mapfile } else { - $maplist{$path} = $1; + $maplist{$mapfile} = $1; } } } @@ -149,34 +149,37 @@ sub loadMapFile { my $mapfile = shift; my $mode; - $::d_ir && msg("opening map file $mapfile\n"); - - if (-r $mapfile) { - delete $irMap{$mapfile}; - open(MAP, $mapfile); - while () { - if (/\[(.+)\]/) { - $mode = $1; - next; - } - chomp; # no newline - s/^\s+//; # no leading white - s/\s+$//; # no trailing white - s/\s*#.*$//; # trim comments (note, no #'s or ='s allowed in button names) - next unless length; #anything left? - my ($buttonName, $function) = split(/\s*=\s*/, $_, 2); - unless ($buttonName =~ /(.+)\.\*/) { - $irMap{$mapfile}{$mode}{$buttonName} = $function; - } else { - foreach my $style (@buttonPressStyles) { - $irMap{$mapfile}{$mode}{$1 . $style} = $function unless exists($irMap{$mapfile}{$mode}{$1 . $style}) ; + foreach my $irfiledir (IRFileDirs()) { + $::d_ir && msg(" key mapping file entry: $mapfile\n"); + my $path = catdir($irfiledir,$mapfile); + $::d_ir && msg("opening map file $path\n"); + if (-r $path) { + delete $irMap{$path}; + open(MAP, $path); + while () { + if (/\[(.+)\]/) { + $mode = $1; + next; + } + chomp; # no newline + s/^\s+//; # no leading white + s/\s+$//; # no trailing white + s/\s*#.*$//; # trim comments (note, no #'s or ='s allowed in button names) + next unless length; #anything left? + my ($buttonName, $function) = split(/\s*=\s*/, $_, 2); + unless ($buttonName =~ /(.+)\.\*/) { + $irMap{$path}{$mode}{$buttonName} = $function; + } else { + foreach my $style (@buttonPressStyles) { + $irMap{$path}{$mode}{$1 . $style} = $function unless exists($irMap{$path}{$mode}{$1 . $style}) ; + } } } + close(MAP); + last; + } else { + $::d_ir && msg("failed to open $path\n"); } - close(MAP); - - } else { - $::d_ir && msg("failed to open $mapfile\n"); } }