peterw;323076 Wrote: 
> 
> For the sleep button, I've also had good luck editing the map file to
> make holding the sleep button do something special, but simply pressing
> the sleep button do its normal tasks -- see AllQuiet (which also has
> ContextMenu support in the latest release).

By the way, today I posted a version of AllQuiet that can, in
SqueezeCenter 7.1 and newer, automatically handle the button mappings.
It remaps the Sleep button so a short press acts like the regular sleep
button and a long press invokes AllQuiet. You could lift the
checkNewPlayer() & mapKeyHold() code to do the same in SvrPowerControl.
(Obviously, a user couldn't map sleep.hold for both our plugins --and
mapKeyHold() refuses to claim sleep.hold if something else uses that
mapping--  but I think SvrPowerControl probably has at least one
hundred times as many users as AllQuiet.)

As for invoking the normal behavior, first, that's not such an issue
when you're only grabbing sleep.hold, and second, you should use
something like Slim::Control::Request::executeRequest() to execute the
normal sleep button code. That brings up another idea (TMTOWTDI) -- you
could wrap the 'button' command with addDispatch -- see the StatusFirst
code -- if you *really* want users to choose between Sleep and
SvrPowerControl.

Frankly I think SvrPowerControl is an excellent candidate for
ContextMenu, but if you really want to use an existing button, AllQuiet
can show you how to do that easily in 7.1+.


-- 
peterw

http://www.tux.org/~peterw/
free plugins: http://www.tux.org/~peterw/#slim
AllQuiet BlankSaver ContextMenu FuzzyTime PlayLog
PowerCenter/BottleRocket 
SaverSwitcher SettingsManager SleepFade StatusFirst SyncOptions
VolumeLock
------------------------------------------------------------------------
peterw's Profile: http://forums.slimdevices.com/member.php?userid=2107
View this thread: http://forums.slimdevices.com/showthread.php?t=48521

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/plugins

Reply via email to