Documentation
¶
Overview ¶
Package keyboard provides helpers to interact with System76 keyboard devices.
Index ¶
- Constants
- Variables
- func BrightnessFileHandler(brightness string) error
- func ColorFileHandler(color string) error
- func EachPresetColor(cb func(name, value string))
- func GetCurrentBrightness() (string, error)
- func GetCurrentColors() (map[string]string, error)
- func LoadEmbeddedColors() error
- func StartMonitor(ctx context.Context, delay time.Duration)
- type ChangeEvent
- type RGBColor
Constants ¶
const RandomColor = "random"
RandomColor is the color name used to pick a randomly generated color code.
Variables ¶
var Events = &events.Manager{}
Events are where Watchers can be created and ChangeEvents are emitted.
Functions ¶
func BrightnessFileHandler ¶
BrightnessFileHandler writes a hex value to brightness and returns the bytes written.
func ColorFileHandler ¶
ColorFileHandler writes a string to colorFiles.
func EachPresetColor ¶
func EachPresetColor(cb func(name, value string))
EachPresetColor iterates all the loaded color names and invokes the provided callback for each one.
func GetCurrentBrightness ¶
GetCurrentBrightness reads the brightness value current set and returns its value.
func GetCurrentColors ¶
GetCurrentColors reads the color values currently set and returns their values.
func LoadEmbeddedColors ¶
func LoadEmbeddedColors() error
LoadEmbeddedColors will parse the embedded colors file into memory for looking up color hex codes by name.
Types ¶
type ChangeEvent ¶ added in v0.4.9
ChangeEvent is an event that is emitted when the current brightness or color is changed.