keytoggles

package
v0.3.13 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 12 Imported by: 1 module, 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

Overview

Package keytoggles watches the keyboards' lock keys through evdev (the Rust shell's osd/toggles.rs): a Caps, Num, or Scroll Lock release reports the key and its LED state once the kernel settled it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Watch

func Watch(fn func(Event)) (stop func())

Watch opens every keyboard under /dev/input and calls fn, from the device's goroutine, for each lock key release. With none readable it logs how to grant access, as the Rust shell does. stop closes the devices and waits for the readers.

Types

type Event

type Event struct {
	Key    Key
	Active bool
}

Event is a lock key released with its LED now on or off.

type Key

type Key uint8

Key is one lock key.

const (
	CapsLock Key = iota
	NumLock
	ScrollLock
)

The watched lock keys.

Jump to

Keyboard shortcuts

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