Documentation ¶
Index ¶
- type Client
- func (c *Client) Close() error
- func (c *Client) ConnectAnyKeyboard(ctx context.Context) error
- func (c *Client) ConnectKeyboard(ctx context.Context, keyboard *api.Keyboard) error
- func (c *Client) ConnectKeyboardIndex(ctx context.Context, id int32) error
- func (c *Client) DecreaseBrightness(ctx context.Context) error
- func (c *Client) DisconnectKeyboard(ctx context.Context) error
- func (c *Client) GetKeyboards(ctx context.Context) (keyboards []*api.Keyboard, err error)
- func (c *Client) GetStatus(ctx context.Context) (version string, keyboard *api.ConnectedKeyboard, err error)
- func (c *Client) IncreaseBrightness(ctx context.Context) error
- func (c *Client) SetLayer(ctx context.Context, layer int32) error
- func (c *Client) SetRGBAll(ctx context.Context, color color.Color) error
- func (c *Client) SetRGBLed(ctx context.Context, color color.Color, leds ...int32) error
- func (c *Client) SetStatusLED(ctx context.Context, led int32, on bool) error
- func (c *Client) UnsetLayer(ctx context.Context, layer int32) error
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 represents a connection to the ZSA keyboard service.
func Connect ¶
Connect establishes a connection to the ZSA keyboard service at the specified path or address.
func ConnectDefault ¶
ConnectDefault establishes a connection to the ZSA keyboard service using default settings. On Windows, it connects to "localhost:50051", on other platforms, it uses the socket file at "$CONFIG_DIR/.keymapp/keymapp.sock" (as specified by https://github.com/zsa/kontroll?tab=readme-ov-file#prerequisites).
func (*Client) ConnectAnyKeyboard ¶
ConnectAnyKeyboard attempts to connect to an arbitrary available keyboard.
func (*Client) ConnectKeyboard ¶
ConnectKeyboard connects to a specific keyboard.
func (*Client) ConnectKeyboardIndex ¶
ConnectKeyboardIndex connects to a specific keyboard by its index.
func (*Client) DecreaseBrightness ¶
DecreaseBrightness decreases the brightness of the keyboard.
func (*Client) DisconnectKeyboard ¶
DisconnectKeyboard disconnects from the currently connected keyboard.
func (*Client) GetKeyboards ¶
GetKeyboards retrieves a list of all detected keyboards.
func (*Client) GetStatus ¶
func (c *Client) GetStatus(ctx context.Context) (version string, keyboard *api.ConnectedKeyboard, err error)
GetStatus retrieves the current status of the keyboard service. The returned keyboard might be "nil" in case none is currently connected.
func (*Client) IncreaseBrightness ¶
IncreaseBrightness increases the brightness of the keyboard.
func (*Client) SetRGBLed ¶
SetRGBLed sets the color of a specific LED on the keyboard. Each additional specified LED tirggers a separate API request. To change all LEDs at once, use "SetRGBAll".
func (*Client) SetStatusLED ¶
SetStatusLED sets the status LED on the keyboard.