Bugzilla – Bug 14007
Cannot intercept IR button presses programatically
Last modified: 2009-10-05 14:38:07 UTC
Prior to change 27975, it was possible to intercept or "wrap" all IR button events in a SqueezeCenter plugin with code like $originalIRCommand = Slim::Control::Request::addDispatch(['ir','_ircode','_time'],[1, 0, 0, \&my_irCommand]); Now Slim::Hardware::IR bypasses the 'ir' command: the old line # process IR code $client->execute(['ir', $entry->{'bytes'}, $entry->{'irTime'}]); has been changed to # process IR code processIR($client, $irCodeBytes, $irTime); This makes it impractical for plugins to intercept IR events -- with this code change, plugins can merely subscribe to IR nofications; they cannot intercept IR commands. Five of my plugins rely on the old behavior and now do not work properly with 7.4, including plugins that have been nominated by users for the Recommended 3rd Party Plugins list. It would be a great help if the core code could switch back to the execute() model.
Andy: Your thoughts on this? I have noticed intermittently on SP devices, the IR not working at all, could this be related?
Hmm, I changed this because a simple IR press did what I thought was too much work and the use of two events (ir + button) seemed a waste. Could you instead intercept button events? James: this is not related to SP.
Andy, I'll have to check that out; that might be viable for some of my plugins. SaverSwitcher needs the 'ir' hook for its button control feature (quickly tap a numbered button to change screensavers). KidsPlay seems perhaps more popular now, and it might work with 'button', the main issue being whether it can discern what key was pressed. If 'button' sends "dead" for keys in off mode, then I'd need a guarantee that I'd see the 'ir' notification before the 'button' command. If so could note which key was pressed and know how to treat the 'button' command. Thanks.
'button' doesn't work well for me. notifyFromArray() must use low-priority timers; even when I modify IR.pm to call notifyFromArray() before processIR(), my plugin doesn't get the 'ir' notification until after the 'button' command fires, which means I cannot reliably tell what button was pressed. This is a significant problem for me; my plugins become prone to modality problems with 'button'. E.G., if in a mode with a custom mapping, I cannot reliably determine what button was pressed.
I'll revert the change. :(
== Auto-comment from SVN commit #28528 to the slim repo by andy == == https://svn.slimdevices.com/slim?view=revision&revision=28528 == Fixed bug 14007, revert improved IR event handling because it breaks plugin functionality
This bug has been marked as fixed in the 7.4.0 release version of SqueezeBox Server! * SqueezeCenter: 28672 * Squeezebox 2 and 3: 130 * Transporter: 80 * Receiver: 65 * Boom: 50 * Controller: 7790 * Radio: 7790 Please see the Release Notes for all the details: http://wiki.slimdevices.com/index.php/Release_Notes If you haven't already, please download and install the new version from http://www.logitechsqueezebox.com/support/download-squeezebox-server.html If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.