Name: Kaleidoscope-HostPowerManagement
Owner: Keyboardio
Description: Host sleep support library for Kaleidoscope
Created: 2017-12-09 10:05:25.0
Updated: 2018-05-15 05:15:05.0
Pushed: 2018-05-15 05:15:07.0
Homepage: null
Size: 27
Language: C++
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Support performing custom actions whenever the host suspends, resumes, or is sleeping. Additionally, this plugin provides optional support for the keyboard to wake the host up from suspend.
To use the plugin, one needs to include the header, and activate it. No further configuration is necessary, unless one wants to perform custom actions.
lude <Kaleidoscope.h>
lude <Kaleidoscope-HostPowerManagement.h>
IDOSCOPE_INIT_PLUGINS(HostPowerManagement);
setup () {
leidoscope.setup ();
stPowerManagement.enableWakeup();
The plugin provides the HostPowerManagement
object, which has the following methods:
.enableWakeup()
Enables host wakeup support. When enabled, pressing any key on the keyboard will wake the host up.
Once enabled, it cannot be disabled again.
hostPowerManagementEventHandler(event)
The
hostPowerManagementEventHandler
method is the brain of the plugin: this function tells it what action to perform in response to the various events.Currently supported events are:
kaleidoscope::HostPowerManagement::Suspend
is fired once when the host suspends;kaleidoscope::HostPowerManagement::Sleep
is fired every cycle while the host is suspended;kaleidoscope::HostPowerManagement::Resume
is fired once when the host wakes up.The default implementation is empty.
Starting from the example is the recommended way of getting started with the plugin.