keyboard

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: MIT Imports: 3 Imported by: 0

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