keyboard

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2026 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Rendered for darwin/amd64

Overview

Package keyboard controls Apple Silicon MacBook keyboard backlight brightness via the private CoreBrightness.framework (KeyboardBrightnessClient).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client controls the keyboard backlight via CoreBrightness.

func NewClient

func NewClient(keyboardID uint64) (*Client, error)

NewClient loads CoreBrightness.framework and creates a KeyboardBrightnessClient. The keyboardID is typically 1 for the built-in keyboard.

func (*Client) GetBrightness

func (c *Client) GetBrightness() float32

GetBrightness returns the current keyboard backlight brightness (0.0–1.0).

func (*Client) SetAutoBrightness

func (c *Client) SetAutoBrightness(enabled bool)

SetAutoBrightness enables or disables auto-brightness for the keyboard.

func (*Client) SetBrightness

func (c *Client) SetBrightness(level float32, fadeMs int)

SetBrightness sets the keyboard backlight brightness (0.0–1.0) with a fade duration in milliseconds.

func (*Client) SetIdleDimTime

func (c *Client) SetIdleDimTime(seconds float64)

SetIdleDimTime sets the idle dim timeout in seconds. Set to 0 to disable.

func (*Client) SuspendIdleDimming

func (c *Client) SuspendIdleDimming(suspend bool)

SuspendIdleDimming suspends or resumes idle dimming.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL