Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added: ApplicationAction to suspend PC #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rbares
Copy link
Contributor

@rbares rbares commented Oct 5, 2019

Fixes #9.

Although the "sleep" button mapping does not work correctly in newer versions of Windows, reliable APIs are available for doing so. This diff adds a new action (alongside "close CECTray" and "start application") which enables the user to configure libCECTray to suspend their PC via a button mapping. This follows the same mechanism as other ApplicationActions but calls Application.SetSuspendState when triggered. The parameters used trigger a suspend (i.e. sleep as opposed to hibernate), forcing the suspend to occur immediately, and ensuring wake events are not disabled when doing so.

@rbares
Copy link
Contributor Author

rbares commented Oct 5, 2019

If you see value in this I'd like to propose an additional PR providing a checkbox in the "Configuration" tab to automatically suspend the PC if the TV changes to a different source. This could work well in use-cases (like mine) where the user interacting with the TV remote should have authority over the PC, rather than the current mechanisms offered by libCECTray which mostly give the PC authority (waking TV, changing active source to PC, putting TV into standby).

Please let me know if this PR and/or the proposed checkbox fit your current intentions for the project.

@rbares
Copy link
Contributor Author

rbares commented Oct 13, 2019

I suspect this PR may benefit from a change to bring it in-line with StopTvStandby as used in CECController.ReceiveCommand. This would send a Stop keypress to each ApplicationController, disable callbacks, and then do a non-forcing suspend. Will wait to hear your view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"sleep" mapping does not work in Windows 10
1 participant