keytographer

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(filePath string) ([]byte, error)

func Validate

func Validate(data []byte) error

Types

type CanvasConfig

type CanvasConfig struct {
	Width           int    `yaml:"width"`
	Height          int    `yaml:"height"`
	BackgroundColor string `yaml:"background_color,omitempty"`
}

type Config

type Config struct {
	Name     string
	Keyboard string `yaml:"keyboard,omitempty"`
	Canvas   CanvasConfig
	Layers   []Layer `yaml:"layers,omitempty"`
	Layout   LayoutConfig
}

func Parse

func Parse(data []byte) (*Config, error)

func (*Config) GetLayer

func (c *Config) GetLayer(name string) *Layer

type Layer

type Layer struct {
	Name string
	Keys []LayerKey `yaml:"keys,omitempty"`
}

type LayerKey

type LayerKey struct {
	Code   string `yaml:"code"`
	Label  string `yaml:"label"`
	Shift  string `yaml:"shift"`
	Hold   string `yaml:"hold"`
	Active bool   `yaml:"active"`
}

type LayoutConfig

type LayoutConfig struct {
	Macro string            `yaml:"macro"`
	Keys  []LayoutKeyConfig `yaml:"keys"`
}

type LayoutKeyConfig

type LayoutKeyConfig struct {
	X float64 `yaml:"x"`
	Y float64 `yaml:"y"`
	W float64 `yaml:"w"`
	H float64 `yaml:"h"`
}

type RenderedLayer

type RenderedLayer struct {
	Name string
	Svg  []byte
}

type Renderer

type Renderer interface {
	RenderAllLayers(*Config) ([]*RenderedLayer, error)
	RenderLayer(*Config, string) (*RenderedLayer, error)
}

func NewRenderer

func NewRenderer() Renderer

Jump to

Keyboard shortcuts

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