keybinds

package
v0.0.0-...-242ead7 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoDiscoverProviders

func AutoDiscoverProviders(registry *Registry, config *DiscoveryConfig) error

func List

func List() []string

func Register

func Register(provider Provider) error

func SetJSONProviderFactory

func SetJSONProviderFactory(factory JSONProviderFactory)

Types

type CheatSheet

type CheatSheet struct {
	Title            string               `json:"title"`
	Provider         string               `json:"provider"`
	Binds            map[string][]Keybind `json:"binds"`
	DMSBindsIncluded bool                 `json:"dmsBindsIncluded"`
	DMSStatus        *DMSBindsStatus      `json:"dmsStatus,omitempty"`
}

type DMSBindsStatus

type DMSBindsStatus struct {
	Exists          bool   `json:"exists"`
	Included        bool   `json:"included"`
	IncludePosition int    `json:"includePosition"`
	TotalIncludes   int    `json:"totalIncludes"`
	BindsAfterDMS   int    `json:"bindsAfterDms"`
	Effective       bool   `json:"effective"`
	OverriddenBy    int    `json:"overriddenBy"`
	StatusMessage   string `json:"statusMessage"`
}

type DiscoveryConfig

type DiscoveryConfig struct {
	SearchPaths []string
}

func DefaultDiscoveryConfig

func DefaultDiscoveryConfig() *DiscoveryConfig

func (*DiscoveryConfig) FindJSONFiles

func (d *DiscoveryConfig) FindJSONFiles() ([]string, error)

type JSONProviderFactory

type JSONProviderFactory func(filePath string) (Provider, error)

type Keybind

type Keybind struct {
	Key             string   `json:"key"`
	Description     string   `json:"desc"`
	Action          string   `json:"action,omitempty"`
	Subcategory     string   `json:"subcat,omitempty"`
	Source          string   `json:"source,omitempty"`
	HideOnOverlay   bool     `json:"hideOnOverlay,omitempty"`
	CooldownMs      int      `json:"cooldownMs,omitempty"`
	Flags           string   `json:"flags,omitempty"` // Hyprland bind flags: e=repeat, l=locked, r=release, o=long-press
	AllowWhenLocked bool     `json:"allowWhenLocked,omitempty"`
	AllowInhibiting *bool    `json:"allowInhibiting,omitempty"` // nil=default(true), false=explicitly disabled
	Repeat          *bool    `json:"repeat,omitempty"`          // nil=default(true), false=explicitly disabled
	Conflict        *Keybind `json:"conflict,omitempty"`
}

type Provider

type Provider interface {
	Name() string
	GetCheatSheet() (*CheatSheet, error)
}

func Get

func Get(name string) (Provider, error)

type Registry

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

func GetDefaultRegistry

func GetDefaultRegistry() *Registry

func NewRegistry

func NewRegistry() *Registry

func (*Registry) Get

func (r *Registry) Get(name string) (Provider, error)

func (*Registry) List

func (r *Registry) List() []string

func (*Registry) Register

func (r *Registry) Register(provider Provider) error

type WritableProvider

type WritableProvider interface {
	Provider
	SetBind(key, action, description string, options map[string]any) error
	RemoveBind(key string) error
	GetOverridePath() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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