Firmware for the Keyboardio Model 01 and other keyboards with AVR or ARM MCUs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Go to file
Gergely Nagy 9dc2daddc5
make astyle
7 years ago
examples/MyOldFriend Add a special `WakeupKeyboard`, to be able to wake the host up 7 years ago
src make astyle 7 years ago
.gitignore Initial import 7 years ago
.travis.yml Initial import 7 years ago
COPYING Initial import 7 years ago
Makefile Initial import 7 years ago
README.md Add a special `WakeupKeyboard`, to be able to wake the host up 7 years ago
library.properties Initial import 7 years ago

README.md

Kaleidoscope-MyOldFriend

status Build Status

Hello darkness, my old friend I've come to talk with you again

Support performing custom actions whenever the host suspends, resumes, or is sleeping. By default, the LEDs will be turned off on suspend, and the previous LED mode restored on resume.

Using the plugin

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.

#include <Kaleidoscope.h>
#include <Kaleidoscope-MyOldFriend.h>

void setup () {
  Kaleidoscope.setup ();

  Kaleidoscope.use(&MyOldFriend);
}

Plugin methods

The plugin provides the MyOldFriend 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.

.toggleLEDs(event)

Turns LEDs off on suspend, restores the previous LED mode on resume. This is called by myOldFriendEventHandler() by default.

Overrideable methods

myOldFriendEventHandler(event)

The myOldFriendEventHandler 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::MyOldFriend::Suspend is fired once when the host suspends; kaleidoscope::MyOldFriend::Sleep is fired every cycle while the host is suspended; kaleidoscope::MyOldFriend::Resume is fired once when the host wakes up.

The default implementation calls MyOldFriend.toggleLEDs. When overriding the function, the default is lost.

Dependencies

Further reading

Starting from the example is the recommended way of getting started with the plugin.